From sucotronic at gmail.com Mon Feb 4 07:10:02 2008 From: sucotronic at gmail.com (Suco) Date: Mon, 4 Feb 2008 13:10:02 +0100 Subject: [Gtk-sharp-list] Transparent tray icon Message-ID: <256d62360802040410t4081c6c1ie3fc43dfc0968d64@mail.gmail.com> I've find this documentation about tray icons with mono: http://www.mono-project.com/GtkSharpNotificationIcon But the result tray icon doesn't have a transparent background. This is my code this.icon = Gdk.Pixbuf.LoadFromResource("pru.png"); Gtk.Image kk = new Gtk.Image(icon.ScaleSimple(24, 24, Gdk.InterpType.Hyper)); EventBox eb = new EventBox(); eb.Add(kk); eb.ButtonPressEvent += new ButtonPressEventHandler(OnTrayClicked); TrayIcon Icon = new TrayIcon("pru"); Icon.GdkWindow.SetBackPixmap (null, true); Icon.ShowAll(); Any idea to solve it? From linux at famped.dk Mon Feb 4 13:30:16 2008 From: linux at famped.dk (Jesper K. Pedersen) Date: Mon, 4 Feb 2008 19:30:16 +0100 Subject: [Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming) Message-ID: <20080204193016.77adeabe@io.solnet> I am making a small application using Gtk#/C# where I have a collection of data stored in a ListStore. What I am trying to get done is that when the ListStore content change through user input via the GUI a backend datastore will automatically update its data. My ListStore is presented to the user in a TreeView and I can enter/change my data without a problem. I cannot get the ListStore.RowChanged event to call my function that will send the updated data back to the backend service. I have tried limiting my "ListStore Changed" callback to just containing a callout of a debug message to my log but nothing show up. I have also tried adding a button that manually calls the ListStore.EmitRowChanged method but my method is still not responding. Anyone with an example of using the ListStore.RowChanged event? I suspect that here is some sort of "interference" with the TreeView use of the ListStore to keep the treeview updated but I have no clue of how to get around that - or even if that is the case. Any hints are greatly appreciated. Best regards JesperKP From adam at morrison-ind.com Mon Feb 4 13:44:29 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Mon, 04 Feb 2008 13:44:29 -0500 Subject: [Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming) In-Reply-To: <20080204193016.77adeabe@io.solnet> References: <20080204193016.77adeabe@io.solnet> Message-ID: <1202150669.6888.5.camel@WM_ADAM1.morrison.iserv.net> > I am making a small application using Gtk#/C# where I have a collection > of data stored in a ListStore. Are you adding data to the treeview as values (like strings, etc...) or are you mapping the ListStore directly only your objects? Ultimately I find doing the later to be simpler as there is nothing to sync. > What I am trying to get done is that when the ListStore content change > through user input via the GUI a backend datastore will automatically > update its data. I think you want to fire an event from the TreeView (or contained widget), not from the ListStore; the TreeView needs to notify the application data has changed. I think ListStore.RowChanged notifies the widget (or whatever container) that the data has changed in the backend and the widget needs to be updated. But that is off the top of my head so I could be wrong. > My ListStore is presented to the user in a TreeView and I can > enter/change my data without a problem. > I cannot get the ListStore.RowChanged event to call my function that > will send the updated data back to the backend service. > I have tried limiting my "ListStore Changed" callback to just > containing a callout of a debug message to my log but nothing show up. > I have also tried adding a button that manually calls the > ListStore.EmitRowChanged method but my method is still not responding. > Anyone with an example of using the ListStore.RowChanged event? > I suspect that here is some sort of "interference" with the TreeView > use of the ListStore to keep the treeview updated but I have no clue of > how to get around that - or even if that is the case. > Any hints are greatly appreciated. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080204/1de54b49/attachment.bin From mkestner at gmail.com Mon Feb 4 14:23:24 2008 From: mkestner at gmail.com (Mike Kestner) Date: Mon, 04 Feb 2008 13:23:24 -0600 Subject: [Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming) In-Reply-To: <20080204193016.77adeabe@io.solnet> References: <20080204193016.77adeabe@io.solnet> Message-ID: <1202153004.4657.35.camel@t61p.site> On Mon, 2008-02-04 at 19:30 +0100, Jesper K. Pedersen wrote: > My ListStore is presented to the user in a TreeView and I can > enter/change my data without a problem. > > I cannot get the ListStore.RowChanged event to call my function that > will send the updated data back to the backend service. You aren't really clear here, but I'm guessing you mean you have editable cell renderers in this tree to perform this entry/updating. If so, you need to connect to the signal on the CellRenderer which indicates an edit has completed, and post the data to your model. If on the other hand, you are talking about a tree selection based update, where you want to post something to your "backend service" when the selected row changes, you use the TreeView.Selection object to detect changes like that. ListStore.RowChanged will not fire in the selection changed scenario above, and won't fire in the CellRenderer.Edited scenario until you post the changed value back to the ListStore. -- Mike Kestner From linux at famped.dk Mon Feb 4 15:47:29 2008 From: linux at famped.dk (Jesper K. Pedersen) Date: Mon, 4 Feb 2008 21:47:29 +0100 Subject: [Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming) In-Reply-To: <1202150669.6888.5.camel@WM_ADAM1.morrison.iserv.net> References: <20080204193016.77adeabe@io.solnet> <1202150669.6888.5.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <20080204214729.614b1ad6@io.solnet> On Mon, 04 Feb 2008 13:44:29 -0500 Adam Tauno Williams wrote: > > I am making a small application using Gtk#/C# where I have a > > collection of data stored in a ListStore. > > Are you adding data to the treeview as values (like strings, etc...) > or are you mapping the ListStore directly only your objects? > Ultimately I find doing the later to be simpler as there is nothing > to sync. > It is just simple updates of text contained in a ListStore through a TreeView with editable cellrenders. The cellrenders update my data "mid-end" (my ListStore) just fine. The data is text from a database source - where I am basically using the ListStore as a cache on selects and I am trying to get a "write through" effect on updating data. > > > What I am trying to get done is that when the ListStore content > > change through user input via the GUI a backend datastore will > > automatically update its data. > > I think you want to fire an event from the TreeView (or contained > widget), not from the ListStore; the TreeView needs to notify the > application data has changed. I think ListStore.RowChanged notifies > the widget (or whatever container) that the data has changed in the > backend and the widget needs to be updated. But that is off the top > of my head so I could be wrong. > Trying to stay in the mindset of "object oriented data management" I would prefer if my data itself can handle the updating of my backend (in this case a database). Also as my data will at some point be able to be changed by other parts of my application beside the graphical front end. As a sidenote... I just tried it out with a simple test program without using a TreeView with a ListStore containing a few fields and then adding my own RowChanged event handler and that works as I would expect it to. I get a RowChanged event for every change that happens to my ListStore object. So it must be the TreeView container who grab the RowChanged event and stops it from reaching my own eventhandler. I cant from the manual of Gtk# see if that is an intended effect or not (it would seem I am "haplessly incompetent" at reading manual pages) Thank's JesperKP From adam at morrison-ind.com Wed Feb 6 09:17:08 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Wed, 06 Feb 2008 09:17:08 -0500 Subject: [Gtk-sharp-list] Printing in Gtk# In-Reply-To: <101aa8890801231458i536622daq5affec60619b6285@mail.gmail.com> References: <101aa8890801231458i536622daq5affec60619b6285@mail.gmail.com> Message-ID: <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> > I am trying to do some printing with Gtk# and I am having some > problems. Can anyone point me to a good reference for this. The mono > documentation is giving me much help and I can't really find any > examples. If you could point me in a general direction or maybe give > me an overview of how it works I would appreciate it. Thanks. I'm also in need of this information; if you find any good resources please let me know. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080206/053e2613/attachment-0001.bin From sucotronic at gmail.com Thu Feb 7 04:39:43 2008 From: sucotronic at gmail.com (Suco) Date: Thu, 7 Feb 2008 10:39:43 +0100 Subject: [Gtk-sharp-list] Printing in Gtk# In-Reply-To: <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> References: <101aa8890801231458i536622daq5affec60619b6285@mail.gmail.com> <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <256d62360802070139k7a886327i390bdae1c9a1c5d9@mail.gmail.com> I've been searching for mono applications with tray icons, and the most famous is Tomboy. But tomboy uses a different way to create a tray icon through a dll. I continue looking for a native implementation in C# for the issue. On Feb 6, 2008 3:17 PM, Adam Tauno Williams wrote: > > I am trying to do some printing with Gtk# and I am having some > > problems. Can anyone point me to a good reference for this. The mono > > documentation is giving me much help and I can't really find any > > examples. If you could point me in a general direction or maybe give > > me an overview of how it works I would appreciate it. Thanks. > > I'm also in need of this information; if you find any good resources > please let me know. > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > From anders at iola.dk Thu Feb 7 09:02:07 2008 From: anders at iola.dk (Anders Rune Jensen) Date: Thu, 7 Feb 2008 15:02:07 +0100 Subject: [Gtk-sharp-list] Why does gtk sharp still use mcs (.NET 1.1) Message-ID: <260c534f0802070602v6053243dm9220f39122390b34@mail.gmail.com> Hi I stumpled into the following issue today: https://bugzilla.novell.com/show_bug.cgi?id=359561 So a few questions is in place I guess. Why doesn't gtk sharp use generics? And is there any effort to convert it? Furthermore how much of the code is generated and how much is written by hand? Thanks -- Anders Rune Jensen http://people.iola.dk/arj/ From spam at pvanhoof.be Thu Feb 7 09:43:37 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Thu, 07 Feb 2008 15:43:37 +0100 Subject: [Gtk-sharp-list] Seeking a .NET binding maintainer for Tinymail Message-ID: <1202395418.8607.36.camel@schtrumpf> Hi there, I'm looking for a passionate C# developer who's willing to understand how both GObject and GtkSharp's Gapi work in high detail to maintain Tinymail's DotNet bindings. The raw bindings are already finished and working. There are, however, a lot of nuances that could be done better. Example todo items are case per case analysing the callback mechanisms of each asynchronous API in Tinymail. Gapi generated nice C# delegates but there might be scoping issues here and there (the garbage collector being too quick with unreferencing the delegate itself, I'm not sure). It might also be nice to make it use the asynchronous pattern that is used in System.* in .NET. Another problem is property vs. method. Some of Tinymail's APIs are intended to be methods, but got generated as a property, and some got generated as a method but where intended as a property. My own guideline to distinguish between a property and a method is what Brad Adams & co. in his/their "Framework design guidelines" book wrote: if it's quickly accessible, it should probably be a property in stead of a method. If accessing the field takes time, it should probably be a get method. I already made the Tny.List interface-type implement IEnumeratable, the Tny.Iterator therefore implements IEnumerator. It would be sweet if things like LINQ would work. I have not yet tested this. I also have an interface-based type called Tny.Stream. Instances that are a Tny.Stream could also inherit System.IO.Stream after the binding is done with it. This would foster further integration with .NET too. Other than that updating the binding as soon as an API change occurred in the C API would be among the tasks. I think maintaining Tinymail's .NET bindings will be comparable in difficulty to the directory "gtk" of GtkSharp's code: mostly getting the .custom files and the .metadata files right. If somebody is interested, here are some pointers: The current working raw binding: https://svn.tinymail.org/svn/tinymail/trunk/bindings/dotnet/ The current working C# DotNet demo user interface: https://svn.tinymail.org/svn/tinymail/trunk/tests/dotnet-demo/ Tinymail's mailing list http://mail.gnome.org/mailman/listinfo/tinymail-devel-list Right now nobody is yet funding the .NET bindings of Tinymail. I'm planning to someday port Tinymail's GObject code to WinCE. I think the Compact Framework .NET is lacking a good E-mail library and a decent E-mail client. Your binding would help filling up this gap. ps. Via the Camel-MAPI effort being done by a Novell team working on Evolution, we'll soon have MAPI support too, in case you are mostly interested in talking with Exchange servers. -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From spam at pvanhoof.be Thu Feb 7 10:01:08 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Thu, 07 Feb 2008 16:01:08 +0100 Subject: [Gtk-sharp-list] Why does gtk sharp still use mcs (.NET 1.1) In-Reply-To: <260c534f0802070602v6053243dm9220f39122390b34@mail.gmail.com> References: <260c534f0802070602v6053243dm9220f39122390b34@mail.gmail.com> Message-ID: <1202396468.8607.43.camel@schtrumpf> On Thu, 2008-02-07 at 15:02 +0100, Anders Rune Jensen wrote: > Hi > > I stumpled into the following issue today: > > https://bugzilla.novell.com/show_bug.cgi?id=359561 > > So a few questions is in place I guess. Why doesn't gtk sharp use > generics? And is there any effort to convert it? Furthermore how much > of the code is generated and how much is written by hand? pvanhoof at schtrumpf:~/repos/mono/gtk-sharp$ cat */*.custom | wc -l 11540 pvanhoof at schtrumpf:~/repos/mono/gtk-sharp$ Note about Generics that few of the GObject code that is being wrapped with what Gapi generates, is very 'generic-aware' written imo. Something that I would love to see support generics is GtkTreeModel and its GetValue method. I'm atm not sure how doable this would be. Less related: If you want to see a GObject using project that aims at providing a higher language that does support generics (or something that looks like generics): take a look at Vala. It has a few types that do generics in its Gee library (like, it has a Hashtable and a few List types). -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From m.j.hutchinson at gmail.com Thu Feb 7 14:15:06 2008 From: m.j.hutchinson at gmail.com (Michael Hutchinson) Date: Thu, 7 Feb 2008 14:15:06 -0500 Subject: [Gtk-sharp-list] Transparent tray icon In-Reply-To: <256d62360802040410t4081c6c1ie3fc43dfc0968d64@mail.gmail.com> References: <256d62360802040410t4081c6c1ie3fc43dfc0968d64@mail.gmail.com> Message-ID: On Feb 4, 2008 7:10 AM, Suco wrote: > I've find this documentation about tray icons with mono: > http://www.mono-project.com/GtkSharpNotificationIcon > > But the result tray icon doesn't have a transparent background. > This is my code > this.icon = Gdk.Pixbuf.LoadFromResource("pru.png"); > Gtk.Image kk = new Gtk.Image(icon.ScaleSimple(24, 24, Gdk.InterpType.Hyper)); > > EventBox eb = new EventBox(); > eb.Add(kk); > eb.ButtonPressEvent += new ButtonPressEventHandler(OnTrayClicked); > > TrayIcon Icon = new TrayIcon("pru"); > Icon.GdkWindow.SetBackPixmap (null, true); > Icon.ShowAll(); > > Any idea to solve it? That page has unfortunately not been updated in 2.5 years, and it's likely that some things have changed since it was last updated. It also makes a lot of X11-specific call, which is not portable. It's probably possible to make it work, but I'm not surre how. Did you try it unscaled? If you're using GTK# 2.10 or later, there's a new cross-platform StatusIcon class that may be useful to you -- and also a TrayIcon class that's X11 only but offers the ability to plug in arbitrary widgets. -- Michael Hutchinson http://mjhutchinson.com From christian.hergert at gmail.com Thu Feb 7 14:39:05 2008 From: christian.hergert at gmail.com (Christian Hergert) Date: Thu, 7 Feb 2008 11:39:05 -0800 Subject: [Gtk-sharp-list] Why does gtk sharp still use mcs (.NET 1.1) In-Reply-To: <1202396468.8607.43.camel@schtrumpf> References: <260c534f0802070602v6053243dm9220f39122390b34@mail.gmail.com> <1202396468.8607.43.camel@schtrumpf> Message-ID: <6d4a25b10802071139p6e810280h5b8ed1e8ae2435e7@mail.gmail.com> Remember there are a lot of people that don't target the 2.0 runtime yet. Going to generics would totally alienate them. -- Christian On Feb 7, 2008 7:01 AM, Philip Van Hoof wrote: > > On Thu, 2008-02-07 at 15:02 +0100, Anders Rune Jensen wrote: > > Hi > > > > I stumpled into the following issue today: > > > > https://bugzilla.novell.com/show_bug.cgi?id=359561 > > > > So a few questions is in place I guess. Why doesn't gtk sharp use > > generics? And is there any effort to convert it? Furthermore how much > > of the code is generated and how much is written by hand? > > pvanhoof at schtrumpf:~/repos/mono/gtk-sharp$ cat */*.custom | wc -l > 11540 > pvanhoof at schtrumpf:~/repos/mono/gtk-sharp$ > > Note about Generics that few of the GObject code that is being wrapped > with what Gapi generates, is very 'generic-aware' written imo. > > Something that I would love to see support generics is GtkTreeModel and > its GetValue method. I'm atm not sure how doable this would be. > > > Less related: > > If you want to see a GObject using project that aims at providing a > higher language that does support generics (or something that looks like > generics): take a look at Vala. It has a few types that do generics in > its Gee library (like, it has a Hashtable and a few List types). > > > -- > Philip Van Hoof, freelance software developer > home: me at pvanhoof dot be > gnome: pvanhoof at gnome dot org > http://pvanhoof.be/blog > http://codeminded.be > > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > From mkestner at gmail.com Thu Feb 7 15:22:02 2008 From: mkestner at gmail.com (Mike Kestner) Date: Thu, 07 Feb 2008 14:22:02 -0600 Subject: [Gtk-sharp-list] Printing in Gtk# In-Reply-To: <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> References: <101aa8890801231458i536622daq5affec60619b6285@mail.gmail.com> <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <1202415722.4657.42.camel@t61p.site> On Wed, 2008-02-06 at 09:17 -0500, Adam Tauno Williams wrote: > > I am trying to do some printing with Gtk# and I am having some > > problems. Can anyone point me to a good reference for this. The mono > > documentation is giving me much help and I can't really find any > > examples. If you could point me in a general direction or maybe give > > me an overview of how it works I would appreciate it. Thanks. > > I'm also in need of this information; if you find any good resources > please let me know. If you haven't discovered it, there is a sample in the gtk-sharp tarball for printing in the GtkDemo application. You can find it at: sample/GtkDemo/DemoPrinting.cs There are numerous examples in the GNOME release of using the API in C. It would be great if someone could provide a tutorial for using this on the mono-project.com wiki. Mike From wasabi at larvalstage.net Thu Feb 7 15:02:22 2008 From: wasabi at larvalstage.net (Jerome Haltom) Date: Thu, 07 Feb 2008 14:02:22 -0600 Subject: [Gtk-sharp-list] Why does gtk sharp still use mcs (.NET 1.1) In-Reply-To: <6d4a25b10802071139p6e810280h5b8ed1e8ae2435e7@mail.gmail.com> References: <260c534f0802070602v6053243dm9220f39122390b34@mail.gmail.com> <1202396468.8607.43.camel@schtrumpf> <6d4a25b10802071139p6e810280h5b8ed1e8ae2435e7@mail.gmail.com> Message-ID: <1202414542.13527.1.camel@station-1.ad.isillc.com> A lot of libraries I've used have released 2.0 versions to be used by 2.0 users. Basically ifdefs adding in additional useful abilities using generics, but not preventing any abilities for those without generic support. That said, I don't know what use Gtk could derive from supporting generics. You can already create generic types that inherit from Gtk base types, so that's not an issue. On Thu, 2008-02-07 at 11:39 -0800, Christian Hergert wrote: > Remember there are a lot of people that don't target the 2.0 runtime > yet. Going to generics would totally alienate them. > > -- Christian > > On Feb 7, 2008 7:01 AM, Philip Van Hoof wrote: > > > > On Thu, 2008-02-07 at 15:02 +0100, Anders Rune Jensen wrote: > > > Hi > > > > > > I stumpled into the following issue today: > > > > > > https://bugzilla.novell.com/show_bug.cgi?id=359561 > > > > > > So a few questions is in place I guess. Why doesn't gtk sharp use > > > generics? And is there any effort to convert it? Furthermore how much > > > of the code is generated and how much is written by hand? > > > > pvanhoof at schtrumpf:~/repos/mono/gtk-sharp$ cat */*.custom | wc -l > > 11540 > > pvanhoof at schtrumpf:~/repos/mono/gtk-sharp$ > > > > Note about Generics that few of the GObject code that is being wrapped > > with what Gapi generates, is very 'generic-aware' written imo. > > > > Something that I would love to see support generics is GtkTreeModel and > > its GetValue method. I'm atm not sure how doable this would be. > > > > > > Less related: > > > > If you want to see a GObject using project that aims at providing a > > higher language that does support generics (or something that looks like > > generics): take a look at Vala. It has a few types that do generics in > > its Gee library (like, it has a Hashtable and a few List types). > > > > > > -- > > Philip Van Hoof, freelance software developer > > home: me at pvanhoof dot be > > gnome: pvanhoof at gnome dot org > > http://pvanhoof.be/blog > > http://codeminded.be > > > > > > _______________________________________________ > > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list From mail.gery at gmail.com Thu Feb 7 15:39:36 2008 From: mail.gery at gmail.com (Gergely Kiss) Date: Thu, 7 Feb 2008 21:39:36 +0100 Subject: [Gtk-sharp-list] Drawing and printing pages in GTK# Message-ID: Dear list members! Greetings to all of you. I work on an accounting project and I'm looking for the proper method to draw lines and characters to a virtual paper on screen and to be able to print the page. What widget should I use to do that? Ther's a widget in MonoDevelop called 'Drawing area', but I don't know how to use it or can I use it, at all, to generate bills. Thanks for your help! George -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080207/ff4cadc7/attachment.html From m.j.hutchinson at gmail.com Thu Feb 7 16:35:46 2008 From: m.j.hutchinson at gmail.com (Michael Hutchinson) Date: Thu, 7 Feb 2008 16:35:46 -0500 Subject: [Gtk-sharp-list] Why does gtk sharp still use mcs (.NET 1.1) In-Reply-To: <1202414542.13527.1.camel@station-1.ad.isillc.com> References: <260c534f0802070602v6053243dm9220f39122390b34@mail.gmail.com> <1202396468.8607.43.camel@schtrumpf> <6d4a25b10802071139p6e810280h5b8ed1e8ae2435e7@mail.gmail.com> <1202414542.13527.1.camel@station-1.ad.isillc.com> Message-ID: On Feb 7, 2008 3:02 PM, Jerome Haltom wrote: > A lot of libraries I've used have released 2.0 versions to be used by > 2.0 users. Basically ifdefs adding in additional useful abilities using > generics, but not preventing any abilities for those without generic > support. > > That said, I don't know what use Gtk could derive from supporting > generics. You can already create generic types that inherit from Gtk > base types, so that's not an issue. The specific example that started this thread was that a very large amount of object boxing is going on internally -- a performance issue, rather than an API issue. Generating/shipping 2.0 assemblies would allow similar internal performance optimisations to be #ifdef'ed when people identify them. -- Michael Hutchinson http://mjhutchinson.com From adam at morrison-ind.com Thu Feb 7 16:56:31 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Thu, 07 Feb 2008 16:56:31 -0500 Subject: [Gtk-sharp-list] Drawing and printing pages in GTK# In-Reply-To: References: Message-ID: <1202421391.5892.9.camel@WM_ADAM1.morrison.iserv.net> > Greetings to all of you. I work on an accounting project and I'm > looking for the proper method to draw lines and characters to a > virtual paper on screen and to be able to print the page. What widget > should I use to do that? Ther's a widget in MonoDevelop called > 'Drawing area', but I don't know how to use it or can I use it, at > all, to generate bills. I don't know anything about *printing* but the drawing area, etc.. are pretty well documented with a fair amount of examples available. See http://code.google.com/p/consonance/source/browse/trunk/Gtk/Calendar/Whitemice.Gtk.Calendar/DayStrip.cs for an example that draws a calendar like http://docs.google.com/Doc?id=ddv5htgd_23c4spt3gj There has been "how to print" traffic on this list very recently. Apparently there is a sample/GtkDemo/DemoPrinting.cs distributed with mono. But I haven't checked it out yet. Someone else suggested getting a System.Drawing.Graphics object via Gtk.DotNet and giving that to System.Drawing.Printing. Of course another option for things like bills & invoices would be to generate a PDF. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080207/5e852990/attachment.bin From anders at iola.dk Thu Feb 7 17:17:19 2008 From: anders at iola.dk (Anders Rune Jensen) Date: Thu, 7 Feb 2008 23:17:19 +0100 Subject: [Gtk-sharp-list] Why does gtk sharp still use mcs (.NET 1.1) In-Reply-To: <6d4a25b10802071139p6e810280h5b8ed1e8ae2435e7@mail.gmail.com> References: <260c534f0802070602v6053243dm9220f39122390b34@mail.gmail.com> <1202396468.8607.43.camel@schtrumpf> <6d4a25b10802071139p6e810280h5b8ed1e8ae2435e7@mail.gmail.com> Message-ID: <260c534f0802071417y615947ccw7ef8fed2ce170517@mail.gmail.com> On Feb 7, 2008 8:39 PM, Christian Hergert wrote: > Remember there are a lot of people that don't target the 2.0 runtime > yet. Going to generics would totally alienate them. And keeping with 1.1 only will falsely make people think that mono is a big memory hog when it fact it's merely a problem with the gtk bindings. -- Anders Rune Jensen http://people.iola.dk/arj/ From mkestner at gmail.com Thu Feb 7 18:17:14 2008 From: mkestner at gmail.com (Mike Kestner) Date: Thu, 07 Feb 2008 17:17:14 -0600 Subject: [Gtk-sharp-list] Why does gtk sharp still use mcs (.NET 1.1) In-Reply-To: <260c534f0802071417y615947ccw7ef8fed2ce170517@mail.gmail.com> References: <260c534f0802070602v6053243dm9220f39122390b34@mail.gmail.com> <1202396468.8607.43.camel@schtrumpf> <6d4a25b10802071139p6e810280h5b8ed1e8ae2435e7@mail.gmail.com> <260c534f0802071417y615947ccw7ef8fed2ce170517@mail.gmail.com> Message-ID: <1202426234.4657.64.camel@t61p.site> On Thu, 2008-02-07 at 23:17 +0100, Anders Rune Jensen wrote: > On Feb 7, 2008 8:39 PM, Christian Hergert wrote: > > Remember there are a lot of people that don't target the 2.0 runtime > > yet. Going to generics would totally alienate them. > > And keeping with 1.1 only will falsely make people think that mono is > a big memory hog when it fact it's merely a problem with the gtk > bindings. Gtk# has to continue to work on 1.0 for as long as mono continues to support it as a mainstream option, which it still clearly does. If I understand the scenario correctly, in order for us to continue that support, while also supporting a performance enhanced version for 2.0 users, we would have to install two separate versions of the Gtk# assemblies which reference the 1.1 and 2.0 corlibs and somehow come up with a mechanism to allow compiling against each version. My guess is that users would want that selection to happen automatically based on the choice between gmcs and mcs. I can't even think of a way to do that without hacking mcs/gmcs, which I suspect would be met with resistance. The installed and downloadable footprint of Gtk# would essentially double. The Gtk# codebase would increase in complexity because of conditional compilation to activate the use of generic and non-generic code paths. Those are among the reasons Gtk# will most likely not see a 2.0 dependency any time soon. Now, as to your original observation of boxing issues with ArrayList, as Miguel pointed out to me on IRC, that can easily be worked around by using a uint[] instead and manually growing/shrinking it. I would be more likely to accept a patch like that, with corresponding profiling results, than a new dependency on 2.0. Mike From monouser at gmail.com Fri Feb 8 09:04:40 2008 From: monouser at gmail.com (Darwin Reynoso) Date: Fri, 8 Feb 2008 09:04:40 -0500 Subject: [Gtk-sharp-list] Help, textview Message-ID: Hi, how do i select a line in a textview. thanks From sucotronic at gmail.com Fri Feb 8 09:54:59 2008 From: sucotronic at gmail.com (Suco) Date: Fri, 8 Feb 2008 15:54:59 +0100 Subject: [Gtk-sharp-list] Printing in Gtk# In-Reply-To: <1202415722.4657.42.camel@t61p.site> References: <101aa8890801231458i536622daq5affec60619b6285@mail.gmail.com> <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> <1202415722.4657.42.camel@t61p.site> Message-ID: <256d62360802080654g2715fcc9v541bb038a950387c@mail.gmail.com> In the tarball the indicated file doesn't exist. These are the files in the directory: DemoApplicationWindow.cs DemoHyperText.cs DemoStockBrowser.cs DemoAttribute.cs DemoIconView.cs DemoTextView.cs DemoButtonBox.cs DemoImages.cs DemoTreeStore.cs DemoClipboard.cs DemoListStore.cs DemoUIManager.cs DemoColorSelection.cs DemoMain.cs images DemoDialog.cs DemoMenus.cs Makefile.am DemoDrawingArea.cs DemoPanes.cs Makefile.in DemoEditableCells.cs DemoPixbuf.cs README DemoEntryCompletion.cs DemoRotatedText.cs TODO DemoExpander.cs DemoSizeGroup.cs On Feb 7, 2008 9:22 PM, Mike Kestner wrote: > > > On Wed, 2008-02-06 at 09:17 -0500, Adam Tauno Williams wrote: > > > I am trying to do some printing with Gtk# and I am having some > > > problems. Can anyone point me to a good reference for this. The mono > > > documentation is giving me much help and I can't really find any > > > examples. If you could point me in a general direction or maybe give > > > me an overview of how it works I would appreciate it. Thanks. > > > > I'm also in need of this information; if you find any good resources > > please let me know. > > If you haven't discovered it, there is a sample in the gtk-sharp tarball > for printing in the GtkDemo application. You can find it at: > > sample/GtkDemo/DemoPrinting.cs > > There are numerous examples in the GNOME release of using the API in C. > It would be great if someone could provide a tutorial for using this on > the mono-project.com wiki. > > Mike > > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > From miltondp at gmail.com Fri Feb 8 11:09:02 2008 From: miltondp at gmail.com (Milton Pividori) Date: Fri, 08 Feb 2008 14:09:02 -0200 Subject: [Gtk-sharp-list] Printing in Gtk# In-Reply-To: <256d62360802080654g2715fcc9v541bb038a950387c@mail.gmail.com> References: <101aa8890801231458i536622daq5affec60619b6285@mail.gmail.com> <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> <1202415722.4657.42.camel@t61p.site> <256d62360802080654g2715fcc9v541bb038a950387c@mail.gmail.com> Message-ID: <1202486942.6387.2.camel@wasabi> Here you can find some examples using GtkPrint: http://code.google.com/p/zaspe-sharp/source/browse/trunk/zaspe-sharp/MonoReporter/ On Fri, 2008-02-08 at 15:54 +0100, Suco wrote: > In the tarball the indicated file doesn't exist. These are the files > in the directory: > DemoApplicationWindow.cs DemoHyperText.cs DemoStockBrowser.cs > DemoAttribute.cs DemoIconView.cs DemoTextView.cs > DemoButtonBox.cs DemoImages.cs DemoTreeStore.cs > DemoClipboard.cs DemoListStore.cs DemoUIManager.cs > DemoColorSelection.cs DemoMain.cs images > DemoDialog.cs DemoMenus.cs Makefile.am > DemoDrawingArea.cs DemoPanes.cs Makefile.in > DemoEditableCells.cs DemoPixbuf.cs README > DemoEntryCompletion.cs DemoRotatedText.cs TODO > DemoExpander.cs DemoSizeGroup.cs > > > On Feb 7, 2008 9:22 PM, Mike Kestner wrote: > > > > > > On Wed, 2008-02-06 at 09:17 -0500, Adam Tauno Williams wrote: > > > > I am trying to do some printing with Gtk# and I am having some > > > > problems. Can anyone point me to a good reference for this. The mono > > > > documentation is giving me much help and I can't really find any > > > > examples. If you could point me in a general direction or maybe give > > > > me an overview of how it works I would appreciate it. Thanks. > > > > > > I'm also in need of this information; if you find any good resources > > > please let me know. > > > > If you haven't discovered it, there is a sample in the gtk-sharp tarball > > for printing in the GtkDemo application. You can find it at: > > > > sample/GtkDemo/DemoPrinting.cs > > > > There are numerous examples in the GNOME release of using the API in C. > > It would be great if someone could provide a tutorial for using this on > > the mono-project.com wiki. > > > > Mike > > > > > > _______________________________________________ > > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list -- Milton Pividori Blog: http://www.miltonpividori.com.ar Jabber ID: milton.pividori at jabberes.org GnuPG Public Key: gpg --keyserver wwwkeys.pgp.net --recv-key 0x663C185C From mlgs at arsis.net Sun Feb 10 09:34:12 2008 From: mlgs at arsis.net (mlgs at arsis.net) Date: Sun, 10 Feb 2008 15:34:12 +0100 (CET) Subject: [Gtk-sharp-list] Gtk# Databindings Message-ID: <45334.193.77.149.154.1202654052.squirrel@user.arsis.net> Hello to all interested! I went silent since there was no feedback (lately I was inaccessible from irc, and mail?... I don't read it anyway). So I had to take the hard way of polishing things. By dogfooding them on my commercial software currently in development. As soon as I figure out how to post changes from my newly setup notebook to svn on sourceforge version 1.0.0 will be out. What it does and what it doesn't do. Ok, here we go: What it doesn't: - It won't make pigs fly, that's for sure. But object data and forms are another subject. Those do fly - Doesn't provide direct connection to database. This topic is better described in FUTURE part of the message What it provides: - Connection to any object you create and live data transfer between object and form or form and object. Live editing is the name - All widget types with DataBindings enabled. Each having two datasources (DataSource and BoundaryDataSource. Mappings and BoundaryMappings. DataSource inheritance for both original and boundary - Pointer like DataSource structure. Show the (Pointer) Adaptor as DataSource and you can simply change its Target once and change it across your application. Adaptor on Adaptor to provide more complex data bounding is also possible - Posting method to notify databindings they should update for that object. Usable if you edit object outside any form. Best usage is to put that line in set part of the property - Automatic posting of notifications if changes come from form - Complex IconView, Treeview and ComboBox mappings - TreeView drag/drop rearranging of actual data or rearranging it from code with live update of items - Usable from monodevelop. Just reference library and controls are usable in stetic - Observable object and Observable lists. Those are subject to move in version 2.0.0 because I don't believe Gtk.DataBindings is the best namespace for them. And since moving triggers and making them generic is part of 2.0.0 those will become subject to move (I appreciate any suggestion on namespace, but read FUTURE first) - 5 usage samples (2.0.0 will feature a lot more in extra widgets library) - documentation (which has to change in regards with boundary databindings. Dogfooding showed me completely different usage that it was originally planned. And this small change is the last one gtk-databind-lib will get before 1.0.0) FUTURE ====== There is already 1.9x in the works which sanitizes sources and makes them more sensible if this would be taken as the start for some other DataBindings. Plan for 2.0 (will be finished in about 2 months if I get feedback): - Moving events and connections to System.Data.Triggers and make them applicable to any framework not just Gtk#. Gtk# will become just example how to plug anything inside trigger messaging. (System.Data.Triggers is not the default name, but so far this is most suitable name. Either this or Mono.Data.Triggers, which I don't like so because it will work on MS.NET also. Any suggestion is welcome). This is in the first plan, meanwhile I'll be only working on database bindings on paper based on the feedback I get. If there won't be any feedback, there won't be any database bindings from me. Simple as that. 50% done - Complete set of additional specialized widgets (part to demonstrate the use, part to provide more complex widgets). gtk-extrawidget-lib is the name. Mostly done already. - Make the database bindings. But here I will need feedback from anyone interested. (and nope, not the feedback like Databound Treeview in january). If you're interested into database bindings I will accept only usage cases (where you provide samples which contain SQL script (or mono executable source) to create table and simple console application where you connect to database, list records into console and maybe change one record, delete...). Based on those I will create databindings to work with all (sane) cases. I'm very interested in anyone brainstorming this as long as it is generic applicable. p.s. Only databases on linux are taken as valid samples. I don't have windows computer at the moment and I don't even remotely plan to have one. p.p.s. Before anyone thinks about TreeView bindings and why there are no database bindings... My goal was to provide fully featured bindings for it and ComboBox. And since TreeView was named Tree... for a reason and database data is single dimensional... Preferred method of contacting me is irc. Usually I'm on either on #monodevelop or #mono as mm. If I'm not there (my irc is almost always open) just leave me a message and I will contact back ASAP. You can contact me even if it is only help with databindings you need. mm From spam at pvanhoof.be Sun Feb 10 09:27:51 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Sun, 10 Feb 2008 15:27:51 +0100 Subject: [Gtk-sharp-list] Handling errors when generating binding code for asynchronous APIs Message-ID: <1202653671.8450.110.camel@schtrumpf> Hi there, I'm trying to make GtkSharp's GAPI generate the typical asynchronous GObject style C API to something that looks a bit like the Asynchronous Pattern often used in .NET. My plan is not to achieve an exact version of the Asynchronous pattern, but nonetheless something workable. Some pointers: http://msdn2.microsoft.com/en-us/library/wewwczdw.aspx http://msdn2.microsoft.com/en-us/library/aa719595(VS.71).aspx Versus, for example, this one: http://tinymail.org/API/libtinymail-1.0/libtinymail-tny-folder.html#tny-folder-get-msg-async http://tinymail.org/API/libtinymail-1.0/libtinymail-tny-shared.html#TnyGetMsgCallback It's actually awesome about GtkSharp's GAPI, but not surprisingly did GAPI do a splendid job already. There's however one big problem: The GError based error being passed to the callback (which in C is a function pointer typedeffed as TnyGetMsgCallback) is not being converted to an Exception type. My goal is to wrap the "IntPtr err" (which is the GError pointer in C) with a factory's Create method that will create me the right managed exception: public class Tny.ExceptionFactory { static Tny.TException Create (IntPtr gerror) { // Pseudo, to get the type I'll indeed need to make // a small piece of glue code in C ... if (gerror->type == TNY_ERROR_THIS) return new Tny.ThisException (gerror); if (gerror->type == TNY_ERROR_THAT) return new Tny.ThatException (gerror); ... } } That way can my application developer use the error being reported in the callback using his normal exception handling methods. For example: - private void GetMsgCallBack (Tny.Folder folder, bool cancel, Tny.Msg msg, IntPtr err) + private void GetMsgCallBack (Tny.Folder folder, bool cancel, Tny.Msg msg, Tny.TException err) { - if (err != IntPtr.Zero) { - Exception ex = new Tny.TException (err); - Console.WriteLine (ex.Message); + if (err != null) + throw err; // Or do whatever with Exceptions } else { if (msg != null && !cancel) this.msg_view.Msg = msg; } } Note that throwing it is not necessarily what the application developer will want to do with the exception. In that callback he'll typically want to show an error dialog to the user with the err.Message displayed. To achieve this, after doing some analysis on Gapi's generator, this is my conclusion: Parameter needs a new property Wrapper that looks a lot like its Scope parameter (gets it from the XML file) Signature::ToString() needs to recognise parameters that are to be wrapped (change the type) CallbackGen::Generate(GenerationInfo) needs to be verified that sig.ToString() does the right thing CallbackGen::GenWrapper(GenerationInfo) at line 227 needs to wrap the parameter with p.Wrapper ## This ## Would become ## This namespace Tny { using System; public delegate void FolderCallback(Tny.Folder self, bool cancelled, IntPtr err); } ## Would become (err's type comes from the XML above) namespace Tny { using System; public delegate void FolderCallback(Tny.Folder self, bool cancelled, Tny.TException err); } ## This internal class FolderCallbackWrapper { public void NativeCallback (IntPtr self, bool cancelled, IntPtr err, IntPtr user_data) { try { Tny.Folder _arg0 = Tny.FolderAdapter.GetObject (self, false); bool _arg1 = cancelled; IntPtr _arg2 = err; managed ( _arg0, _arg1, _arg2); if (release_on_call) gch.Free (); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, false); } } ... } ## Would become (arg2 wrap comes from the XML above) internal class FolderCallbackWrapper { public void NativeCallback (IntPtr self, bool cancelled, IntPtr err, IntPtr user_data) { try { Tny.Folder _arg0 = Tny.FolderAdapter.GetObject (self, false); bool _arg1 = cancelled; IntPtr _arg2 = err; managed ( _arg0, _arg1, Tny.ExceptionFactory.Create (_arg2)); if (release_on_call) gch.Free (); } catch (Exception e) { GLib.ExceptionManager.RaiseUnhandledException (e, false); } } ... } -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From spam at pvanhoof.be Sun Feb 10 10:33:58 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Sun, 10 Feb 2008 16:33:58 +0100 Subject: [Gtk-sharp-list] Handling errors when generating binding code for asynchronous APIs In-Reply-To: <1202653671.8450.110.camel@schtrumpf> References: <1202653671.8450.110.camel@schtrumpf> Message-ID: <1202657638.8450.114.camel@schtrumpf> ps. I think the wrapper_type things can be replaced with the already existing "pass_as" attribute. On Sun, 2008-02-10 at 15:27 +0100, Philip Van Hoof wrote: > Hi there, > > I'm trying to make GtkSharp's GAPI generate the typical asynchronous > GObject style C API to something that looks a bit like the Asynchronous > Pattern often used in .NET. > > My plan is not to achieve an exact version of the Asynchronous pattern, > but nonetheless something workable. > > Some pointers: > http://msdn2.microsoft.com/en-us/library/wewwczdw.aspx > http://msdn2.microsoft.com/en-us/library/aa719595(VS.71).aspx > > Versus, for example, this one: > http://tinymail.org/API/libtinymail-1.0/libtinymail-tny-folder.html#tny-folder-get-msg-async > http://tinymail.org/API/libtinymail-1.0/libtinymail-tny-shared.html#TnyGetMsgCallback > > It's actually awesome about GtkSharp's GAPI, but not surprisingly did > GAPI do a splendid job already. There's however one big problem: > > The GError based error being passed to the callback (which in C is a > function pointer typedeffed as TnyGetMsgCallback) is not being converted > to an Exception type. > > My goal is to wrap the "IntPtr err" (which is the GError pointer in C) > with a factory's Create method that will create me the right managed > exception: > > public class Tny.ExceptionFactory > { > static Tny.TException Create (IntPtr gerror) { > // Pseudo, to get the type I'll indeed need to make > // a small piece of glue code in C ... > if (gerror->type == TNY_ERROR_THIS) > return new Tny.ThisException (gerror); > if (gerror->type == TNY_ERROR_THAT) > return new Tny.ThatException (gerror); > ... > } > } > > That way can my application developer use the error being reported in > the callback using his normal exception handling methods. > > For example: > > - private void GetMsgCallBack (Tny.Folder folder, bool cancel, Tny.Msg msg, IntPtr err) > + private void GetMsgCallBack (Tny.Folder folder, bool cancel, Tny.Msg msg, Tny.TException err) > { > - if (err != IntPtr.Zero) { > - Exception ex = new Tny.TException (err); > - Console.WriteLine (ex.Message); > + if (err != null) > + throw err; // Or do whatever with Exceptions > } else { > if (msg != null && !cancel) > this.msg_view.Msg = msg; > } > } > > Note that throwing it is not necessarily what the application developer > will want to do with the exception. In that callback he'll typically > want to show an error dialog to the user with the err.Message displayed. > > To achieve this, after doing some analysis on Gapi's generator, this is > my conclusion: > > Parameter needs a new property Wrapper that looks a lot like its Scope parameter (gets it from the XML file) > Signature::ToString() needs to recognise parameters that are to be wrapped (change the type) > CallbackGen::Generate(GenerationInfo) needs to be verified that sig.ToString() does the right thing > CallbackGen::GenWrapper(GenerationInfo) at line 227 needs to wrap the parameter with p.Wrapper > > > ## This > > > > > > > > > > > > > ## Would become > > > > > > > > > > > > > ## This > > namespace Tny { > > using System; > > public delegate void FolderCallback(Tny.Folder self, bool cancelled, IntPtr err); > > } > > > ## Would become (err's type comes from the XML above) > > namespace Tny { > > using System; > > public delegate void FolderCallback(Tny.Folder self, bool cancelled, Tny.TException err); > > } > > ## This > > internal class FolderCallbackWrapper { > public void NativeCallback (IntPtr self, bool cancelled, IntPtr err, IntPtr user_data) > { > try { > Tny.Folder _arg0 = Tny.FolderAdapter.GetObject (self, false); > bool _arg1 = cancelled; > IntPtr _arg2 = err; > managed ( _arg0, _arg1, _arg2); > if (release_on_call) > gch.Free (); > } catch (Exception e) { > GLib.ExceptionManager.RaiseUnhandledException (e, false); > } > } > ... > } > > > ## Would become (arg2 wrap comes from the XML above) > > internal class FolderCallbackWrapper { > public void NativeCallback (IntPtr self, bool cancelled, IntPtr err, IntPtr user_data) > { > try { > Tny.Folder _arg0 = Tny.FolderAdapter.GetObject (self, false); > bool _arg1 = cancelled; > IntPtr _arg2 = err; > managed ( _arg0, _arg1, Tny.ExceptionFactory.Create (_arg2)); > if (release_on_call) > gch.Free (); > } catch (Exception e) { > GLib.ExceptionManager.RaiseUnhandledException (e, false); > } > } > ... > } > > -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From mkestner at gmail.com Sun Feb 10 11:30:58 2008 From: mkestner at gmail.com (Mike Kestner) Date: Sun, 10 Feb 2008 10:30:58 -0600 Subject: [Gtk-sharp-list] Handling errors when generating binding code for asynchronous APIs In-Reply-To: <1202653671.8450.110.camel@schtrumpf> References: <1202653671.8450.110.camel@schtrumpf> Message-ID: <1202661058.4657.97.camel@t61p.site> On Sun, 2008-02-10 at 15:27 +0100, Philip Van Hoof wrote: > The GError based error being passed to the callback (which in C is a > function pointer typedeffed as TnyGetMsgCallback) is not being converted > to an Exception type. First, I'm not convinced there's a real advantage to using an exception for this. Throwing it is only going to result in the program exiting in the virtual method marshaler's try/catch or if the user has connected to GLib.ExceptionManager they'll get the exception there. So throwing the exception would just be additional overhead since they can just call the error handler directly from the method implementation itself. > My goal is to wrap the "IntPtr err" (which is the GError pointer in C) > with a factory's Create method that will create me the right managed > exception: > > public class Tny.ExceptionFactory > { > static Tny.TException Create (IntPtr gerror) { > // Pseudo, to get the type I'll indeed need to make > // a small piece of glue code in C ... > if (gerror->type == TNY_ERROR_THIS) > return new Tny.ThisException (gerror); > if (gerror->type == TNY_ERROR_THAT) > return new Tny.ThatException (gerror); > ... > } > } It sounds to me like an error string to enumeration mapping would be equally as useful. Regardless, if you are set on creating exceptions for these, there is already a built in way to hook in a marshaling method like the above to GAPI. You will need to alter the type of the parameter to something GAPI doesn't handle automatically, like TError, using metadata. Also using metadata, you need to add a generatable mapping for TError. Two possibilities are: This assumes the existence of a Tny.Error type which has an IntPtr Handle prop to marshal to native and a static Tny.Error New (IntPtr) method to marshal from native. As an alternative you could use MarshalGen via: Which gives a bit more control over the way you implement your marshaler. You can add either of the above symbols to your API file with an add-node rule in metadata: ... Mike From spam at pvanhoof.be Sun Feb 10 11:47:49 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Sun, 10 Feb 2008 17:47:49 +0100 Subject: [Gtk-sharp-list] Handling errors when generating binding code for asynchronous APIs In-Reply-To: <1202661058.4657.97.camel@t61p.site> References: <1202653671.8450.110.camel@schtrumpf> <1202661058.4657.97.camel@t61p.site> Message-ID: <1202662069.8450.117.camel@schtrumpf> That might indeed solve it. Then I can still make a ToException in my TError.cs type. Right? Here are the diffs: http://tinymail.org/trac/tinymail/changeset/3392 http://tinymail.org/trac/tinymail/browser/trunk/bindings/dotnet/tny/TError.cs Thanks On Sun, 2008-02-10 at 10:30 -0600, Mike Kestner wrote: > On Sun, 2008-02-10 at 15:27 +0100, Philip Van Hoof wrote: > > > The GError based error being passed to the callback (which in C is a > > function pointer typedeffed as TnyGetMsgCallback) is not being converted > > to an Exception type. > > First, I'm not convinced there's a real advantage to using an exception > for this. Throwing it is only going to result in the program exiting in > the virtual method marshaler's try/catch or if the user has connected to > GLib.ExceptionManager they'll get the exception there. So throwing the > exception would just be additional overhead since they can just call the > error handler directly from the method implementation itself. > > > My goal is to wrap the "IntPtr err" (which is the GError pointer in C) > > with a factory's Create method that will create me the right managed > > exception: > > > > public class Tny.ExceptionFactory > > { > > static Tny.TException Create (IntPtr gerror) { > > // Pseudo, to get the type I'll indeed need to make > > // a small piece of glue code in C ... > > if (gerror->type == TNY_ERROR_THIS) > > return new Tny.ThisException (gerror); > > if (gerror->type == TNY_ERROR_THAT) > > return new Tny.ThatException (gerror); > > ... > > } > > } > > It sounds to me like an error string to enumeration mapping would be > equally as useful. Regardless, if you are set on creating exceptions > for these, there is already a built in way to hook in a marshaling > method like the above to GAPI. > > You will need to alter the type of the parameter to something GAPI > doesn't handle automatically, like TError, using metadata. Also using > metadata, you need to add a generatable mapping for TError. Two > possibilities are: > > > > This assumes the existence of a Tny.Error type which has an IntPtr > Handle prop to marshal to native and a static Tny.Error New (IntPtr) > method to marshal from native. > > As an alternative you could use MarshalGen via: > > marshal_type="IntPtr" call_fmt="{0}.Handle" from_fmt="Gdk.Event.GetEvent > ({0})" /> > > Which gives a bit more control over the way you implement your > marshaler. > > You can add either of the above symbols to your API file with an > add-node rule in metadata: > > ... > > Mike > > > -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From spam at pvanhoof.be Sun Feb 10 12:03:25 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Sun, 10 Feb 2008 18:03:25 +0100 Subject: [Gtk-sharp-list] Handling errors when generating binding code for asynchronous APIs In-Reply-To: <1202662069.8450.117.camel@schtrumpf> References: <1202653671.8450.110.camel@schtrumpf> <1202661058.4657.97.camel@t61p.site> <1202662069.8450.117.camel@schtrumpf> Message-ID: <1202663005.8450.119.camel@schtrumpf> On Sun, 2008-02-10 at 17:47 +0100, Philip Van Hoof wrote: > That might indeed solve it. Then I can still make a ToException in my > TError.cs type. Right? > > Here are the diffs: > http://tinymail.org/trac/tinymail/changeset/3392 > http://tinymail.org/trac/tinymail/browser/trunk/bindings/dotnet/tny/TError.cs And a few improvements: http://tinymail.org/trac/tinymail/changeset/3394 > Thanks > > > On Sun, 2008-02-10 at 10:30 -0600, Mike Kestner wrote: > > On Sun, 2008-02-10 at 15:27 +0100, Philip Van Hoof wrote: > > > > > The GError based error being passed to the callback (which in C is a > > > function pointer typedeffed as TnyGetMsgCallback) is not being converted > > > to an Exception type. > > > > First, I'm not convinced there's a real advantage to using an exception > > for this. Throwing it is only going to result in the program exiting in > > the virtual method marshaler's try/catch or if the user has connected to > > GLib.ExceptionManager they'll get the exception there. So throwing the > > exception would just be additional overhead since they can just call the > > error handler directly from the method implementation itself. > > > > > My goal is to wrap the "IntPtr err" (which is the GError pointer in C) > > > with a factory's Create method that will create me the right managed > > > exception: > > > > > > public class Tny.ExceptionFactory > > > { > > > static Tny.TException Create (IntPtr gerror) { > > > // Pseudo, to get the type I'll indeed need to make > > > // a small piece of glue code in C ... > > > if (gerror->type == TNY_ERROR_THIS) > > > return new Tny.ThisException (gerror); > > > if (gerror->type == TNY_ERROR_THAT) > > > return new Tny.ThatException (gerror); > > > ... > > > } > > > } > > > > It sounds to me like an error string to enumeration mapping would be > > equally as useful. Regardless, if you are set on creating exceptions > > for these, there is already a built in way to hook in a marshaling > > method like the above to GAPI. > > > > You will need to alter the type of the parameter to something GAPI > > doesn't handle automatically, like TError, using metadata. Also using > > metadata, you need to add a generatable mapping for TError. Two > > possibilities are: > > > > > > > > This assumes the existence of a Tny.Error type which has an IntPtr > > Handle prop to marshal to native and a static Tny.Error New (IntPtr) > > method to marshal from native. > > > > As an alternative you could use MarshalGen via: > > > > > marshal_type="IntPtr" call_fmt="{0}.Handle" from_fmt="Gdk.Event.GetEvent > > ({0})" /> > > > > Which gives a bit more control over the way you implement your > > marshaler. > > > > You can add either of the above symbols to your API file with an > > add-node rule in metadata: > > > > ... > > > > Mike > > > > > > -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From spam at pvanhoof.be Sun Feb 10 16:39:46 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Sun, 10 Feb 2008 22:39:46 +0100 Subject: [Gtk-sharp-list] More finetuned error/exception handling in gapi Message-ID: <1202679586.8450.138.camel@schtrumpf> I noticed this one in MethodBody.cs: public void HandleException (StreamWriter sw, string indent) { if (!ThrowsException) return; sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw new GLib.GException (error);"); } It would be nicer if I could put an exception creator here, in stead of having to use GException. For example one that creates me a specific type of Exception depending on the GError's domain and error code. Just like last question, the one about the asynchronous APIs, is something in place already to do this kind of things? I took a look at GLib.ExceptionManager.UnhandledException but this infrastructure doesn't make it possible for me to turn my exceptions into specific ones. I was thinking about something like this: public class ExceptionFactory { static ExceptionFactory instance = null; static ExceptionFactory Instance { if (instance == null) instance = new ExceptionFactory (); return instance; } XmlElement elem = null; public XmlElement Elem { get { return elem; } set { elem = value; } } public override string ToString () { if (elem != null) return elem.GetAttribute ("creater"); return "new GLib.GException"; } } public void HandleException (StreamWriter sw, string indent) { if (!ThrowsException) return; sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw {0} (error);", ExceptionFactory.Instance.ToString();); } And at Parser.cs:74: case "symbol": if (elem.GetAttribute ("name") == "ExceptionFactory") ExceptionFactory.Instance.Elem = elem; else gens.Add (ParseSymbol (elem)); break; -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From dsmithers at talktalk.net Mon Feb 11 07:02:53 2008 From: dsmithers at talktalk.net (Dan Smithers) Date: Mon, 11 Feb 2008 12:02:53 +0000 Subject: [Gtk-sharp-list] Help with GTK sharp Message-ID: <47B0396D.4090802@talktalk.net> Can anyone suggest a good reference for GTK sharp? I am struggling a bit finding out how to use the interface as it seems to be different from both GTK and .Net. My current problem is trying to set the initial state of a combo box and to get the result. thanks dan From mikkel at linet.dk Mon Feb 11 07:37:12 2008 From: mikkel at linet.dk (Mikkel Kruse Johnsen) Date: Mon, 11 Feb 2008 13:37:12 +0100 Subject: [Gtk-sharp-list] Help with GTK sharp In-Reply-To: <47B0396D.4090802@talktalk.net> References: <47B0396D.4090802@talktalk.net> Message-ID: <1202733432.5529.6.camel@tux.lib.cbs.dk> Hi Dan The best is to look at the API http://www.go-mono.com/docs/ You say that it is different from GTK and .Net, not really sure what you mean. Gtk-sharp is a wrapping of Gtk so it is eksactly the same, so looking for examples written in C is easily converted to C#. In the API of the Gtk.ComboBox you will se the Method: "SetActiveIter" and "GetActiveIter" those are the functions you are looking for. /Mikkel On Mon, 2008-02-11 at 12:02 +0000, Dan Smithers wrote: > Can anyone suggest a good reference for GTK sharp? I am struggling a bit > finding out how to use the interface as it seems to be different from > both GTK and .Net. > > My current problem is trying to set the initial state of a combo box and > to get the result. > > thanks > > dan > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list Med Venlig Hilsen / Kind Regards Mikkel Kruse Johnsen Adm.Dir. Linet ?rholmgade 6 st tv Copenhagen N 2200 Denmark Work: +45 21287793 Mobile: +45 21287793 Email: mikkel at linet.dk IM: mikkel at linet.dk (MSN) Professional Profile Healthcare Network Consultant -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/10438a85/attachment.html From sascha.dewald at googlemail.com Mon Feb 11 09:25:15 2008 From: sascha.dewald at googlemail.com (Sascha Dewald) Date: Mon, 11 Feb 2008 15:25:15 +0100 Subject: [Gtk-sharp-list] problem building c#-bindings for libccc Message-ID: <47B05ACB.1000506@googlemail.com> i have problems, building c#-bindings for libccc. so i created two a patches (see attchments) - for gapi2-parser and gapi2-codegen. with this patches the creation of the c#-bindings will work. please, have a look at the second regex, i think it should work fine, and for libccc it does work, but i am unsure if it has any side-effect's for building it against other c#-bindings best regards echnaton -------------- next part -------------- A non-text attachment was scrubbed... Name: patch_gtk-sharp-2.10.2.diff Type: text/x-patch Size: 550 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/76ba8fc6/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: patch_gtk-sharp-2.10.2__second.diff Type: text/x-patch Size: 493 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/76ba8fc6/attachment-0001.bin From sascha.dewald at googlemail.com Mon Feb 11 09:30:25 2008 From: sascha.dewald at googlemail.com (Sascha Dewald) Date: Mon, 11 Feb 2008 15:30:25 +0100 Subject: [Gtk-sharp-list] problem building c#-bindings for libccc Message-ID: <47B05C01.5060202@googlemail.com> i have problems, building c#-bindings for libccc. so i created two a patches (see attchments) - for gapi2-parser and gapi2-codegen. with this patches the creation of the c#-bindings will work. please, have a look at the second regex, i think it should work fine, and for libccc it does work, but i am unsure if it has any side-effect's for building it against other c#-bindings best regards echnaton -------------- next part -------------- A non-text attachment was scrubbed... Name: patch_gtk-sharp-2.10.2.diff Type: text/x-patch Size: 550 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/7b435877/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: patch_gtk-sharp-2.10.2__second.diff Type: text/x-patch Size: 494 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/7b435877/attachment-0001.bin From adam at morrison-ind.com Mon Feb 11 10:19:07 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Mon, 11 Feb 2008 10:19:07 -0500 Subject: [Gtk-sharp-list] Help with GTK sharp In-Reply-To: <47B0396D.4090802@talktalk.net> References: <47B0396D.4090802@talktalk.net> Message-ID: <20080211101907.0uex5mc0sgk0s4sk@tyr.morrison.iserv.net> > Can anyone suggest a good reference for GTK sharp? Other than monodoc, no. Fortunately there is more and more Gtk# code around to look at. http://www.mono-project.com/GtkSharp#Other_Gtk.23_Tutorials & http://www.mono-project.com/GtkSharp#Beginning_to_use_GTK.23 has some stuff > I am struggling a bit > finding out how to use the interface as it seems to be different from > both GTK and .Net. I'm not clear on what you mean. ".Net" isn't a UI toolkit, so that is apples and oranges. Gtk# is itself just a wrapper around Gtk; which means you can [*theoretically*] use examples in C, but unless you are pretty familiar with C that isn't very helpful. > My current problem is trying to set the initial state of a combo box and > to get the result. Active & ActiveText / GetActiveIter From cdhowie at gmail.com Mon Feb 11 11:10:19 2008 From: cdhowie at gmail.com (Chris Howie) Date: Mon, 11 Feb 2008 11:10:19 -0500 Subject: [Gtk-sharp-list] Help, textview In-Reply-To: References: Message-ID: <3d2f29dc0802110810l642f7e0bt83d5f22f9daf2a80@mail.gmail.com> On Feb 8, 2008 9:04 AM, Darwin Reynoso wrote: > Hi, > how do i select a line in a textview. private void SelectLine(TextView view, int line) { TextBuffer buffer = view.Buffer; TextIter start = buffer.GetIterAtLine(line); TextIter end = buffer.GetIterAtLine(line + 1); buffer.SelectRange(start, end); } P.S. Documentation is a wonderful thing. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From andy at brdstudio.net Mon Feb 11 11:47:21 2008 From: andy at brdstudio.net (Andrew York) Date: Mon, 11 Feb 2008 11:47:21 -0500 Subject: [Gtk-sharp-list] Help with GTK sharp In-Reply-To: <47B0396D.4090802@talktalk.net> References: <47B0396D.4090802@talktalk.net> Message-ID: <47B07C19.70105@brdstudio.net> If you know what you are looking for I will usually search http://www.krugle.org/ and look at existing projects that use what I am working with. I hope that helps Dan Smithers wrote: > Can anyone suggest a good reference for GTK sharp? I am struggling a bit > finding out how to use the interface as it seems to be different from > both GTK and .Net. > > My current problem is trying to set the initial state of a combo box and > to get the result. > > thanks > > dan > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > From vladimir.giszpenc at gmail.com Mon Feb 11 12:34:22 2008 From: vladimir.giszpenc at gmail.com (Vladimir Giszpenc) Date: Mon, 11 Feb 2008 12:34:22 -0500 Subject: [Gtk-sharp-list] Help with GTK sharp Message-ID: <8ed5cbac0802110934y27597e70mdff086a566d8ea2d@mail.gmail.com> Dan, Here is how I set a default: ListStore store = new ListStore(typeof (string)); this.cboLogLevel.Model = store; TreeIter iter = store.AppendValues(LogLevel.Debug.ToString()); this.cboLogLevel.SetActiveIter(iter); Vlad From mlgs at arsis.net Mon Feb 11 17:03:18 2008 From: mlgs at arsis.net (mlgs at arsis.net) Date: Mon, 11 Feb 2008 23:03:18 +0100 (CET) Subject: [Gtk-sharp-list] Bindings In-Reply-To: <8ed5cbac0802110957t6bd04ec2yf19fb507a7ac40d1@mail.gmail.com> References: <8ed5cbac0802110957t6bd04ec2yf19fb507a7ac40d1@mail.gmail.com> Message-ID: <46534.193.77.149.154.1202767398.squirrel@user.arsis.net> > Hi, > > I am interested in data bindings, but I have tons of questions and > comments. Take my comments as questions because I am far from being > an expert. > > TreeView > Relational databases have been bastardized. They now contain XML, > MultiValues and other non normalized hierarchical data. The treeView > could be useful in displaying this sort of thing. > TreeView is also useful for linear too. But,... you've got it correct. Too bastardized to know where to begin. This is why I requested that people send examples where I could look at it without needing to go over every feature by my self. Starting with simple reading writing with DataRow and simple data and all the way to complex approaches. > Why not allow bindings for textView/textEntry/label? Heck, even image > and other widgets could have a model that is tied to a database > component, no? > All widget types are already done... except... TextView and HTML are the only missed widgets so far. TextView.... same reason as database. I would like to see one simple and clean case of usage before I take on that one > Is your binding going to work with libgda? NO! API is not stable and I don't plan to follow every move they make just to keep up with them. that was as far as I was researching. Correct me if I'm wrong. > Are you going to require libgnomedb widgets? NO! read previous > Will you have a dependency on ADO.Net? I would like to build database > applications without the need for encumbered technologies. Though I > come from the MS world, I am trying to be a good citizen now. If they will impose any dependencies then they will be separated into different library. This is why I'm having separation for 2.0. And same controls will allow pluggable Adaptors with form switches (well, have not tested them yet, but I think they should work. Separation is the first step). > Are you planning to team up with Kexi or some other RAD tool? > Basically, MS Access was great in concept. An easy to use database > with optional programming. If we do a Mono version, it would open up > lots of languages as scripting languages... > No, that is not my intention. SQL and scripting already exists for that purpose. I wouldn't like to reinvent the wheel. And since I can't say I correctly understood what you asked here... Isn't kexi reporting software?? Maybe cleaner explanation for someone who didn't understand the reason? > As you can tell, I see bindings being more useful than for just > putting lists on the screen. of course, I understand that you have to > start somewhere. > Yes, and that is why avoided databases so far. Data is way more than database. First I was creating full functionality and now I'll start using unlimited to provide limited. > Thanks, > > Vlad > mm From anthony.taranto at medsphere.com Mon Feb 11 16:17:23 2008 From: anthony.taranto at medsphere.com (anthony taranto) Date: Mon, 11 Feb 2008 13:17:23 -0800 Subject: [Gtk-sharp-list] Help, textview In-Reply-To: <3d2f29dc0802110810l642f7e0bt83d5f22f9daf2a80@mail.gmail.com> References: Message-ID: <1202764643.6463.2.camel@slayer> An embedded and charset-unspecified text was scrubbed... Name: not available Url: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/707f0aba/attachment.pl From monouser at gmail.com Mon Feb 11 17:23:08 2008 From: monouser at gmail.com (Darwin Reynoso) Date: Mon, 11 Feb 2008 17:23:08 -0500 Subject: [Gtk-sharp-list] Help, textview In-Reply-To: <1202764643.6463.2.camel@slayer> References: <3d2f29dc0802110810l642f7e0bt83d5f22f9daf2a80@mail.gmail.com> <1202764643.6463.2.camel@slayer> Message-ID: thanks a lot Chris and Anthony it worked. On Mon, Feb 11, 2008 at 4:17 PM, anthony taranto wrote: > the SelectLine method provided won't select anything if the line > parameter is the last line of the buffer. to handle that case you'd want > something like this: > > > private void SelectLine (TextView view, int line) { > TextBuffer buffer = view.Buffer; > > TextIter start, end; > start = end = buffer.GetIterAtLine (line); > end.LineOffset = start.CharsInLine; > > buffer.SelectRange (start, end); > } > > --anthony > > > > On Mon, 2008-02-11 at 11:10 -0500, Chris Howie wrote: > > On Feb 8, 2008 9:04 AM, Darwin Reynoso wrote: > > > Hi, > > > how do i select a line in a textview. > > > > private void SelectLine(TextView view, int line) { > > TextBuffer buffer = view.Buffer; > > > > TextIter start = buffer.GetIterAtLine(line); > > TextIter end = buffer.GetIterAtLine(line + 1); > > > > buffer.SelectRange(start, end); > > } > > > > P.S. Documentation is a wonderful thing. > > > > From monouser at gmail.com Mon Feb 11 17:37:50 2008 From: monouser at gmail.com (Darwin Reynoso) Date: Mon, 11 Feb 2008 17:37:50 -0500 Subject: [Gtk-sharp-list] Help, textview In-Reply-To: <3d2f29dc0802110810l642f7e0bt83d5f22f9daf2a80@mail.gmail.com> References: <3d2f29dc0802110810l642f7e0bt83d5f22f9daf2a80@mail.gmail.com> Message-ID: as you may or may not know sometimes the documention is not clear enough for a newbie to figure things out but thanks to you and Anthony now i got it. ps: monodevelop is a great app that i enjoy using but i feel we need more examples for newbies like me any way you guys keep up the great job that you have been doing thanks On 2/11/08, Chris Howie wrote: > On Feb 8, 2008 9:04 AM, Darwin Reynoso wrote: > > Hi, > > how do i select a line in a textview. > > private void SelectLine(TextView view, int line) { > TextBuffer buffer = view.Buffer; > > TextIter start = buffer.GetIterAtLine(line); > TextIter end = buffer.GetIterAtLine(line + 1); > > buffer.SelectRange(start, end); > } > > P.S. Documentation is a wonderful thing. > > -- > Chris Howie > http://www.chrishowie.com > http://en.wikipedia.org/wiki/User:Crazycomputers > From monouser at gmail.com Mon Feb 11 22:36:05 2008 From: monouser at gmail.com (Darwin Reynoso) Date: Mon, 11 Feb 2008 22:36:05 -0500 Subject: [Gtk-sharp-list] Gtk-sharp-list Digest, Vol 34, Issue 5 In-Reply-To: References: Message-ID: On Mon, Feb 11, 2008 at 12:18 PM, wrote: > Send Gtk-sharp-list mailing list submissions to > gtk-sharp-list at lists.ximian.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > or, via email, send a message with subject or body 'help' to > gtk-sharp-list-request at lists.ximian.com > > You can reach the person managing the list at > gtk-sharp-list-owner at lists.ximian.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Gtk-sharp-list digest..." > > > Today's Topics: > > 1. More finetuned error/exception handling in gapi (Philip Van Hoof) > 2. Help with GTK sharp (Dan Smithers) > 3. Re: Help with GTK sharp (Mikkel Kruse Johnsen) > 4. problem building c#-bindings for libccc (Sascha Dewald) > 5. problem building c#-bindings for libccc (Sascha Dewald) > 6. Re: Help with GTK sharp (Adam Tauno Williams) > 7. Re: Help, textview (Chris Howie) > 8. Re: Help with GTK sharp (Andrew York) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 10 Feb 2008 22:39:46 +0100 > From: Philip Van Hoof > Subject: [Gtk-sharp-list] More finetuned error/exception handling in > gapi > To: gtk-sharp-list at lists.ximian.com > Message-ID: <1202679586.8450.138.camel at schtrumpf> > Content-Type: text/plain > > I noticed this one in MethodBody.cs: > > public void HandleException (StreamWriter sw, string indent) > { > if (!ThrowsException) > return; > sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw new GLib.GException (error);"); > } > > It would be nicer if I could put an exception creator here, in stead of > having to use GException. For example one that creates me a specific > type of Exception depending on the GError's domain and error code. > > Just like last question, the one about the asynchronous APIs, is > something in place already to do this kind of things? > > I took a look at GLib.ExceptionManager.UnhandledException but this > infrastructure doesn't make it possible for me to turn my exceptions > into specific ones. > > > I was thinking about something like this: > > > > > public class ExceptionFactory { > static ExceptionFactory instance = null; > > static ExceptionFactory Instance { > if (instance == null) > instance = new ExceptionFactory (); > return instance; > } > > XmlElement elem = null; > public XmlElement Elem { > get { return elem; } > set { elem = value; } > } > > public override string ToString () { > if (elem != null) > return elem.GetAttribute ("creater"); > return "new GLib.GException"; > } > } > > public void HandleException (StreamWriter sw, string indent) > { > if (!ThrowsException) > return; > sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw {0} (error);", > ExceptionFactory.Instance.ToString();); > } > > And at Parser.cs:74: > > case "symbol": > if (elem.GetAttribute ("name") == "ExceptionFactory") > ExceptionFactory.Instance.Elem = elem; > else > gens.Add (ParseSymbol (elem)); > break; > > > -- > Philip Van Hoof, freelance software developer > home: me at pvanhoof dot be > gnome: pvanhoof at gnome dot org > http://pvanhoof.be/blog > http://codeminded.be > > > > ------------------------------ > > Message: 2 > Date: Mon, 11 Feb 2008 12:02:53 +0000 > From: Dan Smithers > Subject: [Gtk-sharp-list] Help with GTK sharp > To: gtk-sharp-list at lists.ximian.com > Message-ID: <47B0396D.4090802 at talktalk.net> > Content-Type: text/plain; charset=ISO-8859-1 > > Can anyone suggest a good reference for GTK sharp? I am struggling a bit > finding out how to use the interface as it seems to be different from > both GTK and .Net. > > My current problem is trying to set the initial state of a combo box and > to get the result. > > thanks > > dan > > > ------------------------------ > > Message: 3 > Date: Mon, 11 Feb 2008 13:37:12 +0100 > From: Mikkel Kruse Johnsen > Subject: Re: [Gtk-sharp-list] Help with GTK sharp > To: Dan Smithers > Cc: gtk-sharp-list at lists.ximian.com > Message-ID: <1202733432.5529.6.camel at tux.lib.cbs.dk> > Content-Type: text/plain; charset="utf-8" > > Hi Dan > > The best is to look at the API http://www.go-mono.com/docs/ > > You say that it is different from GTK and .Net, not really sure what you > mean. Gtk-sharp is a wrapping of Gtk so it is eksactly the same, so > looking for examples written in C is easily converted to C#. > > In the API of the Gtk.ComboBox you will se the Method: "SetActiveIter" > and "GetActiveIter" those are the functions you are looking for. > > /Mikkel > > On Mon, 2008-02-11 at 12:02 +0000, Dan Smithers wrote: > > > Can anyone suggest a good reference for GTK sharp? I am struggling a bit > > finding out how to use the interface as it seems to be different from > > both GTK and .Net. > > > > My current problem is trying to set the initial state of a combo box and > > to get the result. > > > > thanks > > > > dan > > _______________________________________________ > > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > Med Venlig Hilsen / Kind Regards > > > Mikkel Kruse > Johnsen > Adm.Dir. > > Linet > ?rholmgade 6 st tv > Copenhagen N 2200 > Denmark > > Work: +45 > 21287793 > Mobile: +45 > 21287793 > Email: > mikkel at linet.dk > IM: > mikkel at linet.dk > (MSN) > Professional > Profile > Healthcare > > > Network > Consultant > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/10438a85/attachment-0001.html > Hi Dan, if you're using monodevelop then try this protected virtual void onBtn1Clicked(object sender, System.EventArgs e) { combobox.AppendText("item"); //get the idea } protected virtual void onBtn2Clicked(object sender, System.EventArgs e) { Console.WriteLine("Item currently selected...{0}",combobox.ActiveText); Console.WriteLine("Index of selected item...{0}",combobox.Active.ToString()); } i hope this work for you > ------------------------------ > > Message: 4 > Date: Mon, 11 Feb 2008 15:25:15 +0100 > From: Sascha Dewald > Subject: [Gtk-sharp-list] problem building c#-bindings for libccc > To: gtk-sharp-list at lists.ximian.com > Message-ID: <47B05ACB.1000506 at googlemail.com> > Content-Type: text/plain; charset="iso-8859-15" > > i have problems, building c#-bindings for libccc. > > so i created two a patches (see attchments) - for gapi2-parser and > gapi2-codegen. > > with this patches the creation of the c#-bindings will work. > > please, have a look at the second regex, i think it should work fine, > and for libccc it does work, but i am unsure if it has any side-effect's > for building it against other c#-bindings > > best regards > echnaton > > > > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: patch_gtk-sharp-2.10.2.diff > Type: text/x-patch > Size: 550 bytes > Desc: not available > Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/76ba8fc6/attachment-0002.bin > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: patch_gtk-sharp-2.10.2__second.diff > Type: text/x-patch > Size: 493 bytes > Desc: not available > Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/76ba8fc6/attachment-0003.bin > > ------------------------------ > > Message: 5 > Date: Mon, 11 Feb 2008 15:30:25 +0100 > From: Sascha Dewald > Subject: [Gtk-sharp-list] problem building c#-bindings for libccc > To: gtk-sharp-list at lists.ximian.com > Message-ID: <47B05C01.5060202 at googlemail.com> > Content-Type: text/plain; charset="iso-8859-15" > > i have problems, building c#-bindings for libccc. > > so i created two a patches (see attchments) - for gapi2-parser and > gapi2-codegen. > > with this patches the creation of the c#-bindings will work. > > please, have a look at the second regex, i think it should work fine, > and for libccc it does work, but i am unsure if it has any side-effect's > for building it against other c#-bindings > > best regards > echnaton > > > > > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: patch_gtk-sharp-2.10.2.diff > Type: text/x-patch > Size: 550 bytes > Desc: not available > Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/7b435877/attachment-0002.bin > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: patch_gtk-sharp-2.10.2__second.diff > Type: text/x-patch > Size: 494 bytes > Desc: not available > Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080211/7b435877/attachment-0003.bin > > ------------------------------ > > Message: 6 > Date: Mon, 11 Feb 2008 10:19:07 -0500 > From: Adam Tauno Williams > Subject: Re: [Gtk-sharp-list] Help with GTK sharp > To: gtk-sharp-list at lists.ximian.com > Message-ID: <20080211101907.0uex5mc0sgk0s4sk at tyr.morrison.iserv.net> > Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; > format="flowed" > > > Can anyone suggest a good reference for GTK sharp? > > Other than monodoc, no. Fortunately there is more and more Gtk# code > around to look at. > > http://www.mono-project.com/GtkSharp#Other_Gtk.23_Tutorials & > http://www.mono-project.com/GtkSharp#Beginning_to_use_GTK.23 > has some stuff > > > I am struggling a bit > > finding out how to use the interface as it seems to be different from > > both GTK and .Net. > > I'm not clear on what you mean. ".Net" isn't a UI toolkit, so that is > apples and oranges. Gtk# is itself just a wrapper around Gtk; which > means you can [*theoretically*] use examples in C, but unless you are > pretty familiar with C that isn't very helpful. > > > My current problem is trying to set the initial state of a combo box and > > to get the result. > > Active & ActiveText / GetActiveIter > > > > ------------------------------ > > Message: 7 > Date: Mon, 11 Feb 2008 11:10:19 -0500 > From: "Chris Howie" > Subject: Re: [Gtk-sharp-list] Help, textview > To: "Darwin Reynoso" , > gtk-sharp-list at lists.ximian.com > Message-ID: > <3d2f29dc0802110810l642f7e0bt83d5f22f9daf2a80 at mail.gmail.com> > Content-Type: text/plain; charset=UTF-8 > > On Feb 8, 2008 9:04 AM, Darwin Reynoso wrote: > > Hi, > > how do i select a line in a textview. > > private void SelectLine(TextView view, int line) { > TextBuffer buffer = view.Buffer; > > TextIter start = buffer.GetIterAtLine(line); > TextIter end = buffer.GetIterAtLine(line + 1); > > buffer.SelectRange(start, end); > } > > P.S. Documentation is a wonderful thing. > > -- > Chris Howie > http://www.chrishowie.com > http://en.wikipedia.org/wiki/User:Crazycomputers > > > ------------------------------ > > Message: 8 > Date: Mon, 11 Feb 2008 11:47:21 -0500 > From: Andrew York > Subject: Re: [Gtk-sharp-list] Help with GTK sharp > To: Dan Smithers > Cc: gtk-sharp-list at lists.ximian.com > Message-ID: <47B07C19.70105 at brdstudio.net> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > If you know what you are looking for I will usually search > http://www.krugle.org/ and look at existing projects that use what I am > working with. > > I hope that helps > > Dan Smithers wrote: > > Can anyone suggest a good reference for GTK sharp? I am struggling a bit > > finding out how to use the interface as it seems to be different from > > both GTK and .Net. > > > > My current problem is trying to set the initial state of a combo box and > > to get the result. > > > > thanks > > > > dan > > _______________________________________________ > > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > > > > > > > > ------------------------------ > > _______________________________________________ > Gtk-sharp-list mailing list > Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > > End of Gtk-sharp-list Digest, Vol 34, Issue 5 > ********************************************* > From jesper at famped.dk Mon Feb 4 12:18:15 2008 From: jesper at famped.dk (Jesper K. Pedersen) Date: Mon, 4 Feb 2008 18:18:15 +0100 Subject: [Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming) Message-ID: <20080204181815.063a9fb2@io.solnet> I am making a small application using Gtk#/C# where I have a collection of data stored in a ListStore. What I am trying to get done is that when the ListStore content change through user input via the GUI a backend datastore will automatically update its data. My ListStore is presented to the user in a TreeView and I can enter/change my data without a problem. I cannot get the ListStore.RowChanged event to call my function that will send the updated data back to the backend service. I have tried limiting my "ListStore Changed" callback to just containing a callout of a debug message to my log but nothing show up. I have also tried adding a button that manually calls the ListStore.EmitRowChanged method but my method is still not responding. Anyone with an example of using the ListStore.RowChanged event? I suspect that here is some sort of "interference" with the TreeView use of the ListStore to keep the treeview updated but I have no clue of how to get around that - or even if that is the case. Any hints are greatly appreciated. Best regards JesperKP From austin at tradelogic.com Wed Feb 6 21:21:35 2008 From: austin at tradelogic.com (Austin Winstanley) Date: Wed, 6 Feb 2008 20:21:35 -0600 Subject: [Gtk-sharp-list] Printing in Gtk# In-Reply-To: <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> References: <101aa8890801231458i536622daq5affec60619b6285@mail.gmail.com> <1202307428.5753.14.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <527a90a10802061821x6bf373fcq541216c14c5422c0@mail.gmail.com> >From what I have seen printing in Gtk# is a pretty difficult business and there is hardly any documentation on it, but printing using System.Drawing.Printing is far easier. You can find a lot of tutorials on printing with System.Drawing.Printing. There is also a project that you can find in the Mono Documentation called Gtk.DotNet where you can get a System.Drawing.Graphics object from a Gdk.Drawable. On Feb 6, 2008 8:17 AM, Adam Tauno Williams wrote: > > I am trying to do some printing with Gtk# and I am having some > > problems. Can anyone point me to a good reference for this. The mono > > documentation is giving me much help and I can't really find any > > examples. If you could point me in a general direction or maybe give > > me an overview of how it works I would appreciate it. Thanks. > > I'm also in need of this information; if you find any good resources > please let me know. > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > -- Thanks, Austin Winstanley Tradelogic Software Group 512.699.6674 From geniwab at hotmail.com Thu Feb 7 21:40:29 2008 From: geniwab at hotmail.com (GusmanB) Date: Thu, 7 Feb 2008 18:40:29 -0800 (PST) Subject: [Gtk-sharp-list] GTK#2 & Gecko-sharp problem Message-ID: <15348351.post@talk.nabble.com> Hi. I've recently installed Mono 1.2.6 on Windows, SharpDevelop and GRE. I'm triying to use the gecko embedded browser, but i got two type of problems: If I use the 1.0 version of the control and GTK# a "NullReferenceException" is thrown when the WebControl is added to a container. If I use the 2.0 version of gecko and GTK# i get the following error: "The located assembly's manifest definition with name 'gtk-sharp' does not match the assembly reference." Using reflector i've found the correct version of gtk-sharp for gecko-sharp 2.0 is 2.4.0.0 but the one shipped with mono is 2.10.0.0. I don't know how to make it work, i'm a newby to mono but an experienced dotNet programmer and it's getting me crazy. Any help will be appreciated. Thanks. -- View this message in context: http://www.nabble.com/GTK-2---Gecko-sharp-problem-tp15348351p15348351.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From adam at morrison-ind.com Tue Feb 12 09:02:31 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Tue, 12 Feb 2008 09:02:31 -0500 Subject: [Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming) In-Reply-To: <20080204181815.063a9fb2@io.solnet> References: <20080204181815.063a9fb2@io.solnet> Message-ID: <1202824951.6018.15.camel@WM_ADAM1.morrison.iserv.net> > I am making a small application using Gtk#/C# where I have a collection > of data stored in a ListStore. > What I am trying to get done is that when the ListStore content change > through user input via the GUI a backend datastore will automatically > update its data. > My ListStore is presented to the user in a TreeView and I can > enter/change my data without a problem. Wasn't this question & answered just asked a few days ago? > I have tried limiting my "ListStore Changed" callback to just > containing a callout of a debug message to my log but nothing show up. > I have also tried adding a button that manually calls the > ListStore.EmitRowChanged method but my method is still not responding. > Anyone with an example of using the ListStore.RowChanged event? That isn't the method you want. That is for the contents of the ListStore notifying the application that something changed. You want the other way around. http://lists.ximian.com/pipermail/gtk-sharp-list/2008-February/008395.html "ListStore.RowChanged will not fire in the selection changed scenario above, and won't fire in the CellRenderer.Edited scenario until you post the changed value back to the ListStore." > I suspect that here is some sort of "interference" with the TreeView > use of the ListStore to keep the treeview updated but I have no clue of > how to get around that - or even if that is the case. Nope. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 194 bytes Desc: This is a digitally signed message part Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080212/04196edd/attachment.bin From mkestner at gmail.com Tue Feb 12 12:02:19 2008 From: mkestner at gmail.com (Mike Kestner) Date: Tue, 12 Feb 2008 11:02:19 -0600 Subject: [Gtk-sharp-list] More finetuned error/exception handling in gapi Message-ID: <1202835739.4657.133.camel@t61p.site> > I noticed this one in MethodBody.cs: > > public void HandleException (StreamWriter sw, string indent) > { > if (!ThrowsException) > return; > sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw new > GLib.GException (error);"); > } > > It would be nicer if I could put an exception creator here, in stead of > having to use GException. For example one that creates me a specific > type of Exception depending on the GError's domain and error code. > > Just like last question, the one about the asynchronous APIs, is > something in place already to do this kind of things? No, the GError conversion is hardcoded to GException currently. > I was thinking about something like this: > > creater="Tny.ExceptionFactory.Create" /> I would probably implement this via an error_handler attribute on the namespace element. That way a different handler per library is possible in api's with multiple namespaces and libraries. A property on GenBase could expose it to the generator. > > public void HandleException (StreamWriter sw, string indent) > { > if (!ThrowsException) > return; > sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw {0} > (error);", > ExceptionFactory.Instance.ToString();); > } Probably would just add a parameter to HandleException to allow Ctor and Method to pass in the error_handler. Both of those classes could just look it up on their container_type. Feel free to add an enhancement bug for this, and patches are welcome, of course. -- Mike Kestner From linux at famped.dk Tue Feb 12 12:21:38 2008 From: linux at famped.dk (Jesper K. Pedersen) Date: Tue, 12 Feb 2008 18:21:38 +0100 Subject: [Gtk-sharp-list] Automatically updating via ListStore.RowChanged event? (beginning C#/Gtk# programming) In-Reply-To: <1202824951.6018.15.camel@WM_ADAM1.morrison.iserv.net> References: <20080204181815.063a9fb2@io.solnet> <1202824951.6018.15.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <20080212182138.57e0d55b@io.solnet> On Tue, 12 Feb 2008 09:02:31 -0500 Adam Tauno Williams wrote: > > I am making a small application using Gtk#/C# where I have a > > collection of data stored in a ListStore. > > What I am trying to get done is that when the ListStore content > > change through user input via the GUI a backend datastore will > > automatically update its data. > > My ListStore is presented to the user in a TreeView and I can > > enter/change my data without a problem. > > Wasn't this question & answered just asked a few days ago? > I am sorry for this double posting - this email had initially been sent through an email account I didnt have registered for this list and I had received a response from the mailing list that it was not released due to that so I sent it through my registered account. The question was commented on - but I did actually get the function to work of calling my database update function on the background on updating the data instead of being initiated by the frontend. We dont agree completely if that is a good method - but I think it makes more "object oriented" sense to have the data itself change it backup storage instead of having this happen as a function of who change it. The advantage I find in this approace is that nomatter who/what/how the data is changed - the change is propagated to the backend storage instead of needing an "update-backend" public method. Thank you - and sorry for the doubleing of the original question. Best regards Jesper KP -- From mlgs at arsis.net Tue Feb 12 16:24:52 2008 From: mlgs at arsis.net (mlgs at arsis.net) Date: Tue, 12 Feb 2008 22:24:52 +0100 (CET) Subject: [Gtk-sharp-list] Gtk# Databindings v.0.98 Message-ID: <46401.193.77.149.154.1202851492.squirrel@user.arsis.net> uploaded on http://gtk-databind.sourceforge.net Separation of engine is already in, so databindings aree now standalone and anything can plug in just as gtk-databind. subclassing Adaptor and ControlAdaptor is all that is needed to plug in. mm From spam at pvanhoof.be Wed Feb 13 10:27:05 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Wed, 13 Feb 2008 16:27:05 +0100 Subject: [Gtk-sharp-list] Tracker bug for Tinymail's .NET language bindings Message-ID: <1202916425.8542.29.camel@schtrumpf> Hi there, This is a tracker bug for Tinymail's .NET language bindings for Gtk-Sharp's GAPI's generator: https://bugzilla.novell.com/show_bug.cgi?id=361505 It points to three patches, three enhancement propsals/bugs. You need to apply those three patches to get the current bindings/dotnet of Tinymail working. With the patches applied it will generate correct exceptions in case of error situations, it will implement Tny.List as IEnumeratable and Tny.Iterator as IEnumerator and it will handle the user_data of async callbacks by not adding it to the managed callback's parameters. You can find the bindings themselves here: https://svn.tinymail.org/svn/tinymail/trunk/bindings/dotnet/ ps. I'm looking for a maintainer for the .NET bindings of Tinymail. If somebody is interested, please let me know. -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From dsmithers at talktalk.net Wed Feb 13 10:35:18 2008 From: dsmithers at talktalk.net (Dan Smithers) Date: Wed, 13 Feb 2008 15:35:18 +0000 Subject: [Gtk-sharp-list] Help with GTK sharp In-Reply-To: <8ed5cbac0802110934y27597e70mdff086a566d8ea2d@mail.gmail.com> References: <8ed5cbac0802110934y27597e70mdff086a566d8ea2d@mail.gmail.com> Message-ID: <47B30E36.8020502@talktalk.net> Thanks Vlad, I've got it working now. Is there a way of combining multiple columns on a ComboBox? I can do it with a TreeView without the dropdown aspect of a combo. Or when I do it on a combo, I get the second column in the drop down and the first in the permanent display. I want to display an integer value, with some explanatory text. Gtk.ComboBox combobox = Gtk.ComboBox.NewText(); Gtk.CellRendererText cell = new Gtk.CellRendererText(); combobox.PackStart(cell, true); combobox.AddAttribute(cell, "text", 0); combobox.AddAttribute(cell, "text", 1); Gtk.ListStore store = new Gtk.ListStore(typeof(int), typeof(string)); combobox.Model = store; for (int i = 0; i < 4; ++i) { store.AppendValues(i, "item "+i.Tostring()); } GtkTreeIter iter; combobox.Model.GetIterFirst(out iter); combobox.Model.SetActiveIter(iter); Vladimir Giszpenc wrote: > Dan, > > Here is how I set a default: > > ListStore store = new ListStore(typeof (string)); > this.cboLogLevel.Model = store; > TreeIter iter = store.AppendValues(LogLevel.Debug.ToString()); > this.cboLogLevel.SetActiveIter(iter); > > Vlad > From mkestner at novell.com Wed Feb 13 13:10:20 2008 From: mkestner at novell.com (Mike Kestner) Date: Wed, 13 Feb 2008 12:10:20 -0600 Subject: [Gtk-sharp-list] Announcing Gtk# release 2.8.5 Message-ID: <1202926220.4093.30.camel@t61p.site> We are pleased to announce release 2.8.5 of Gtk#. Packages are available for supported platforms at: http://mono-project.com/Downloads Source tarball has been uploaded to ftp.gnome.org. This is a bugfix release with limited new API additions. Users of the impending mono 1.9 release should upgrade their 2.8 installs to this release to avoid a potential problem in glade-sharp resulting from recent System.Reflection changes. What is Gtk#: Gtk# is a set of .Net/mono language bindings to assorted Gtk+ and GNOME libraries. Supported libraries include pango, atk, gtk+, libglade, libgnome, libgnomeui, libgnomecanvas, libgnomeprint, libgnomeprintui, libpanelapplet, librsvg, libvte, libgtkhtml, and gconf. What's new in version 2.8.5: - Performance, memory management, and object finalization improvements. - GLib.ExceptionManager to support exception handling in signal callbacks. - Numerous bugfixes Thanks to the contributors to this release: Wade Berrier, Eskil Bylund, Sebastian Dr?ge, Michael Hutchinson, Lluis Sanchez Gaul, and myself. Discussion of Gtk# occurs on gtk-sharp-list at lists.ximian.com and defects can be reported to bugzilla.novell.com, module gtk#. -- Mike Kestner From mkestner at novell.com Wed Feb 13 13:10:27 2008 From: mkestner at novell.com (Mike Kestner) Date: Wed, 13 Feb 2008 12:10:27 -0600 Subject: [Gtk-sharp-list] Announcing Gtk# release 2.10.3 and Gnome# release 2.16.1 Message-ID: <1202926227.4093.31.camel@t61p.site> We are pleased to announce version 2.10.3 of Gtk# and version 2.16.1 of Gnome# . Packages are available for supported platforms at: http://mono-project.com/Downloads Source tarballs have been uploaded to ftp.gnome.org. I'm also happy to announce a coordinated release of Gtk# for the MS runtime produced by the folks at Medsphere. It is available for download at: http://sourceforge.net/project/showfiles.php?group_id=74626&package_id=223067 This is a bugfix release with limited new API additions. Users of the impending mono 1.9 release should upgrade their 2.10/2.16 installs to this release to avoid a potential problem in glade-sharp resulting from recent System.Reflection changes. What is Gtk#: Gtk# and Gnome# are a set of .Net/mono language bindings to assorted Gtk + and GNOME libraries. Supported libraries include pango, atk, gtk+, libglade, libgnome, libgnomeui, libgnomecanvas, libgnomeprint, libgnomeprintui, libpanelapplet, librsvg, libvte, libgtkhtml, and gconf. What's new in version 2.10.3: - Performance, memory management, and object finalization improvements. - GLib.ExceptionManager to support exception handling in signal callbacks. - GLib.IOChannel and GLib.Spawn classes for process spawning. - Numerous bugfixes Thanks to the contributors to this release: Wade Berrier, Eskil Bylund, Sebastian Dr?ge, Michael Hutchinson, Peter Johanson, Lluis Sanchez Gaul, and myself. Discussion of Gtk# occurs on gtk-sharp-list at lists.ximian.com and defects can be reported to bugzilla.novell.com, module gtk#. -- Mike Kestner From mkestner at novell.com Wed Feb 13 15:51:10 2008 From: mkestner at novell.com (Mike Kestner) Date: Wed, 13 Feb 2008 14:51:10 -0600 Subject: [Gtk-sharp-list] [Mono-dev] Announcing Gtk# release 2.10.3 and Gnome# release 2.16.1 In-Reply-To: <47b35076.21d2260a.017d.0e2f@mx.google.com> References: <1202926227.4093.31.camel@t61p.site> <47b35076.21d2260a.017d.0e2f@mx.google.com> Message-ID: <1202935870.4093.50.camel@t61p.site> On Wed, 2008-02-13 at 22:17 +0200, Vladimir Dimitrov wrote: > Hello, > Sorry about the stupid question but why would I use Gtk# 2.8.5 when > there is Gtk# 2.10.3??? Is there any other reason than that I cannot > reference and build apps against older versions of Gtk# if I don't > have them installed (policies didn't work for me with VS 2005) > It was released for support of older platforms which are built on gtk+ version 2.8 and therefore cannot provide Gtk# 2.10.x. If all the platforms you want to support ship gtk+-2.10.0 or later versions, Gtk# 2.10.3 is probably what you want. Our windows installers both provide 2.10.x currently. -- Mike Kestner From mjamon at ntsp.nec.co.jp Thu Feb 14 02:27:40 2008 From: mjamon at ntsp.nec.co.jp (Marc Glenn) Date: Thu, 14 Feb 2008 15:27:40 +0800 Subject: [Gtk-sharp-list] How to Get Row Values from a TreeView Message-ID: <47B3ED6C.8060908@mnl.ntsp.nec.co.jp> Hello everyone, Does anyone know how to retrieve values currently displayed on a TreeView widget? Suppose a row entry from the TreeView was clicked, how can the the data in the row be retrieved? I checked the Mono Documentation but I can't find a method to do this. Thanks for the help Regards, Marc Glenn From spam at pvanhoof.be Thu Feb 14 07:10:16 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Thu, 14 Feb 2008 13:10:16 +0100 Subject: [Gtk-sharp-list] How to Get Row Values from a TreeView In-Reply-To: <47B3ED6C.8060908@mnl.ntsp.nec.co.jp> References: <47B3ED6C.8060908@mnl.ntsp.nec.co.jp> Message-ID: <1202991016.7110.30.camel@schtrumpf> On Thu, 2008-02-14 at 15:27 +0800, Marc Glenn wrote: > Hello everyone, > > Does anyone know how to retrieve values currently displayed on a > TreeView widget? > > Suppose a row entry from the TreeView was clicked, how can the the > data in the row be retrieved? > > I checked the Mono Documentation but I can't find a method to do this. There are a few ways, but this is one possibility: treeview.Selection.Changed += OnSelectionChanged; private void OnSelectionChanged; (object o, EventArgs args) { Gtk.TreeSelection selection = o as Gtk.TreeSelection; YourColumn'sType data; Gtk.TreeModel model; Gtk.TreeIter iter; if (selection.GetSelected (out model, out iter)) { int column = YourColumnNumber; GLib.Value val = GLib.Value.Empty; model.GetValue (iter, column, ref val); data = (YourColumn'sType) val.Val; val.Dispose (); } } Advise: check out the Model View Controller pattern in detail. Change "YourColumn'sType" into "string" in case the data is a string. -- Philip Van Hoof, freelance software developer home: me at pvanhoof dot be gnome: pvanhoof at gnome dot org http://pvanhoof.be/blog http://codeminded.be From david_cantin at videotron.ca Thu Feb 14 14:10:25 2008 From: david_cantin at videotron.ca (David Cantin) Date: Thu, 14 Feb 2008 14:10:25 -0500 Subject: [Gtk-sharp-list] How to update the version of cairo used by gtk-sharp on Window Message-ID: <1203016225.7002.28.camel@ubuntu-tower> Hi I use gtk-sharp, cairo and friends for rendering pdf file's and it's work great. But i got a problem..., When I run my application under Windows, the pdf's are lower in quality as if I run my application under linux. On Linux, I use mono 1.2.6, gtk-sharp 2.10 and cairo 1.4.10 On Windows, I use - mono 1.2.6, gtk-sharp 2.10 and cairo 1.2.6 or - .net1.1 with Medsphere gtk-sharp runtime I guest that the quality difference is due to the difference of cairo version. For some time now, I try without any success to upgrade the version of Cairo used by gtk-sharp on windows, and I start to run out a idea... For now, i have tried to recompile gtk-sharp with the instruction provided here[1]. Also, I fetch the last version of Cairo from their web site and updated libcairo2.dll from the Medsphere runtime directory. I have also updated libpng and zlib. I have also replaced Mono.Cairo.dll from a verion that come from my linux setup... I must admit that I do not understand everything involved here... so, I ask for help ;) David [1] http://live.gnome.org/GTK%2B/Win32/Apps From mjamon at ntsp.nec.co.jp Thu Feb 14 19:56:06 2008 From: mjamon at ntsp.nec.co.jp (Marc Glenn) Date: Fri, 15 Feb 2008 08:56:06 +0800 Subject: [Gtk-sharp-list] How to Get Row Values from a TreeView In-Reply-To: <1202991016.7110.30.camel@schtrumpf> References: <47B3ED6C.8060908@mnl.ntsp.nec.co.jp> <1202991016.7110.30.camel@schtrumpf> Message-ID: <47B4E326.8000202@mnl.ntsp.nec.co.jp> I think this would help. Thank you very much. Philip Van Hoof wrote: > On Thu, 2008-02-14 at 15:27 +0800, Marc Glenn wrote: > >> Hello everyone, >> >> Does anyone know how to retrieve values currently displayed on a >> TreeView widget? >> >> Suppose a row entry from the TreeView was clicked, how can the the >> data in the row be retrieved? >> >> I checked the Mono Documentation but I can't find a method to do this. >> > > There are a few ways, but this is one possibility: > > treeview.Selection.Changed += OnSelectionChanged; > > private void OnSelectionChanged; (object o, EventArgs args) > { > Gtk.TreeSelection selection = o as Gtk.TreeSelection; > YourColumn'sType data; > Gtk.TreeModel model; > Gtk.TreeIter iter; > > if (selection.GetSelected (out model, out iter)) { > int column = YourColumnNumber; > GLib.Value val = GLib.Value.Empty; > model.GetValue (iter, column, ref val); > data = (YourColumn'sType) val.Val; > val.Dispose (); > } > } > > Advise: check out the Model View Controller pattern in detail. > > Change "YourColumn'sType" into "string" in case the data is a string. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080215/7e7fa997/attachment.html From monouser at gmail.com Sun Feb 17 20:08:01 2008 From: monouser at gmail.com (Darwin Reynoso) Date: Sun, 17 Feb 2008 20:08:01 -0500 Subject: [Gtk-sharp-list] Menubar item Message-ID: Hi, how do disable a menubar item for ejample: File New Open Save Quit i'm writing a small text editor and i need to be able to disable the save item when there's no data i'm using monodevelop rc1 thanks for any help From cdhowie at gmail.com Sun Feb 17 21:21:54 2008 From: cdhowie at gmail.com (Chris Howie) Date: Sun, 17 Feb 2008 21:21:54 -0500 Subject: [Gtk-sharp-list] Menubar item In-Reply-To: References: Message-ID: <3d2f29dc0802171821k2fee3123r7d0b851ad73610a0@mail.gmail.com> On Feb 17, 2008 8:08 PM, Darwin Reynoso wrote: > Hi, > how do disable a menubar item for ejample: File > New > Open > Save > Quit > i'm writing a small text editor and i need to be able to disable the > save item when there's no data i'm using monodevelop rc1 When you click Save in the designer, you can set the action name in the properties window. You can then refer to this name in code. So if you set it to SaveAction then just set: this.SaveAction.Sensitive = false; Using your own logic for determining this state, of course. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From 17606378421925563254 at mail.orkut.com Sun Feb 17 23:34:26 2008 From: 17606378421925563254 at mail.orkut.com (Paulo Aboim Pinto) Date: Sun, 17 Feb 2008 20:34:26 -0800 Subject: [Gtk-sharp-list] orkut - Invitation to join from Paulo Aboim Pinto Message-ID: <1203309266.2.17606378421925563254.4@mail.orkut.com> You have been invited to join Paulo Aboim Pinto's (esqueleto at tusofona.com) network of friends at orkut. To join orkut click on the following link: http://www.orkut.com/Join.aspx?id=47B90AD26D532088 Having problems? If you get an error when you try to accept this invitation, you may need to copy and paste this URL into a new browser window. * * * orkut is a community of friends and trusted acquaintances that connects individuals through a social network that grows person by person. With orkut, you can catch up with old friends, make new acquaintances through people you trust, and maybe even find that certain someone you've been looking for everywhere. orkut helps you organize and attend events, join communities that share your interests, and find partners to participate in the activities you most enjoy. * * * If you're already an orkut member, make sure that the email address at which you received this note is entered into your orkut profile. That way, you'll automatically be connected to all of your friends. This invitation was sent on behalf of Paulo Aboim Pinto (esqueleto at tusofona.com). You can block all orkut users from sending you email by visiting: http://www.orkut.com/Block.aspx From andy at brdstudio.net Mon Feb 18 06:02:29 2008 From: andy at brdstudio.net (Andrew York) Date: Mon, 18 Feb 2008 06:02:29 -0500 Subject: [Gtk-sharp-list] Monodevelop 0.19 crashes Message-ID: <47B965C5.4010606@brdstudio.net> I'm having a heck of a time with the new Monodevelop 0.19 RC1. It is crashing often at various times, sometimes when compiling, sometimes when opening a stetic gui. I had little or no problems with 0.18 Beta3. These crashes are happening with OpenSuse 10.1 and Ubuntu 7.2, I'm thinking that maybe I have some config files that need to be cleaned up but I'm not sure. Using the command line MonoDevelop --debug didn't not give me any specific errors that may help, and I didn't see anything unusual with the stack. I would appreciate any trouble shooting tips you may have. Thanks Andy From vlad.dimitrov at gmail.com Wed Feb 13 15:17:47 2008 From: vlad.dimitrov at gmail.com (Vladimir Dimitrov) Date: Wed, 13 Feb 2008 22:17:47 +0200 Subject: [Gtk-sharp-list] [Mono-dev] Announcing Gtk# release 2.10.3 and Gnome# release 2.16.1 In-Reply-To: <1202926227.4093.31.camel@t61p.site> References: <1202926227.4093.31.camel@t61p.site> Message-ID: <47b35076.21d2260a.017d.0e2f@mx.google.com> Hello, Sorry about the stupid question but why would I use Gtk# 2.8.5 when there is Gtk# 2.10.3??? Is there any other reason than that I cannot reference and build apps against older versions of Gtk# if I don't have them installed (policies didn't work for me with VS 2005) Thanks, Vladimir Dimtirov -----Original Message----- From: mono-devel-list-bounces at lists.ximian.com [mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Mike Kestner Sent: Wednesday, February 13, 2008 8:10 PM To: gtk-sharp-list; mono-devel-list at lists.ximian.com Subject: [Mono-dev] Announcing Gtk# release 2.10.3 and Gnome# release 2.16.1 We are pleased to announce version 2.10.3 of Gtk# and version 2.16.1 of Gnome# . Packages are available for supported platforms at: http://mono-project.com/Downloads Source tarballs have been uploaded to ftp.gnome.org. I'm also happy to announce a coordinated release of Gtk# for the MS runtime produced by the folks at Medsphere. It is available for download at: http://sourceforge.net/project/showfiles.php?group_id=74626&package_id=223067 This is a bugfix release with limited new API additions. Users of the impending mono 1.9 release should upgrade their 2.10/2.16 installs to this release to avoid a potential problem in glade-sharp resulting from recent System.Reflection changes. What is Gtk#: Gtk# and Gnome# are a set of .Net/mono language bindings to assorted Gtk + and GNOME libraries. Supported libraries include pango, atk, gtk+, libglade, libgnome, libgnomeui, libgnomecanvas, libgnomeprint, libgnomeprintui, libpanelapplet, librsvg, libvte, libgtkhtml, and gconf. What's new in version 2.10.3: - Performance, memory management, and object finalization improvements. - GLib.ExceptionManager to support exception handling in signal callbacks. - GLib.IOChannel and GLib.Spawn classes for process spawning. - Numerous bugfixes Thanks to the contributors to this release: Wade Berrier, Eskil Bylund, Sebastian Dr?ge, Michael Hutchinson, Peter Johanson, Lluis Sanchez Gaul, and myself. Discussion of Gtk# occurs on gtk-sharp-list at lists.ximian.com and defects can be reported to bugzilla.novell.com, module gtk#. -- Mike Kestner _______________________________________________ Mono-devel-list mailing list Mono-devel-list at lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list From monouser at gmail.com Mon Feb 18 06:08:23 2008 From: monouser at gmail.com (Darwin Reynoso) Date: Mon, 18 Feb 2008 06:08:23 -0500 Subject: [Gtk-sharp-list] Gtk-sharp-list Digest, Vol 34, Issue 8 In-Reply-To: References: Message-ID: On 2/17/08, gtk-sharp-list-request at lists.ximian.com wrote: > Send Gtk-sharp-list mailing list submissions to > gtk-sharp-list at lists.ximian.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > or, via email, send a message with subject or body 'help' to > gtk-sharp-list-request at lists.ximian.com > > You can reach the person managing the list at > gtk-sharp-list-owner at lists.ximian.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Gtk-sharp-list digest..." > > > Today's Topics: > > 1. Announcing Gtk# release 2.8.5 (Mike Kestner) > 2. Announcing Gtk# release 2.10.3 and Gnome# release 2.16.1 > (Mike Kestner) > 3. Re: [Mono-dev] Announcing Gtk# release 2.10.3 and Gnome# > release 2.16.1 (Mike Kestner) > 4. How to Get Row Values from a TreeView (Marc Glenn) > 5. Re: How to Get Row Values from a TreeView (Philip Van Hoof) > 6. How to update the version of cairo used by gtk-sharp on > Window (David Cantin) > 7. Re: How to Get Row Values from a TreeView (Marc Glenn) > 8. Menubar item (Darwin Reynoso) > 9. Re: Menubar item (Chris Howie) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 13 Feb 2008 12:10:20 -0600 > From: Mike Kestner > Subject: [Gtk-sharp-list] Announcing Gtk# release 2.8.5 > To: gtk-sharp-list , mono-devel-list > > Message-ID: <1202926220.4093.30.camel at t61p.site> > Content-Type: text/plain; charset=UTF-8 > > We are pleased to announce release 2.8.5 of Gtk#. Packages are > available for supported platforms at: > > http://mono-project.com/Downloads > > Source tarball has been uploaded to ftp.gnome.org. > > This is a bugfix release with limited new API additions. Users of the > impending mono 1.9 release should upgrade their 2.8 installs to this > release to avoid a potential problem in glade-sharp resulting from > recent System.Reflection changes. > > What is Gtk#: > Gtk# is a set of .Net/mono language bindings to assorted Gtk+ and GNOME > libraries. Supported libraries include pango, atk, gtk+, libglade, > libgnome, libgnomeui, libgnomecanvas, libgnomeprint, libgnomeprintui, > libpanelapplet, librsvg, libvte, libgtkhtml, and gconf. > > What's new in version 2.8.5: > - Performance, memory management, and object finalization improvements. > - GLib.ExceptionManager to support exception handling in signal > callbacks. > - Numerous bugfixes > > Thanks to the contributors to this release: Wade Berrier, Eskil Bylund, > Sebastian Dr?ge, Michael Hutchinson, Lluis Sanchez Gaul, and myself. > > Discussion of Gtk# occurs on gtk-sharp-list at lists.ximian.com and defects > can be reported to bugzilla.novell.com, module gtk#. > > -- > Mike Kestner > > > > ------------------------------ > > Message: 2 > Date: Wed, 13 Feb 2008 12:10:27 -0600 > From: Mike Kestner > Subject: [Gtk-sharp-list] Announcing Gtk# release 2.10.3 and Gnome# > release 2.16.1 > To: gtk-sharp-list , > mono-devel-list at lists.ximian.com > Message-ID: <1202926227.4093.31.camel at t61p.site> > Content-Type: text/plain; charset=UTF-8 > > We are pleased to announce version 2.10.3 of Gtk# and version 2.16.1 of > Gnome# . Packages are available for supported platforms at: > > http://mono-project.com/Downloads > > Source tarballs have been uploaded to ftp.gnome.org. > > I'm also happy to announce a coordinated release of Gtk# for the MS > runtime produced by the folks at Medsphere. It is available for > download at: > > http://sourceforge.net/project/showfiles.php?group_id=74626&package_id=223067 > > This is a bugfix release with limited new API additions. Users of the > impending mono 1.9 release should upgrade their 2.10/2.16 installs to > this release to avoid a potential problem in glade-sharp resulting from > recent System.Reflection changes. > > What is Gtk#: > Gtk# and Gnome# are a set of .Net/mono language bindings to assorted Gtk > + and GNOME libraries. Supported libraries include pango, atk, gtk+, > libglade, libgnome, libgnomeui, libgnomecanvas, libgnomeprint, > libgnomeprintui, libpanelapplet, librsvg, libvte, libgtkhtml, and gconf. > > What's new in version 2.10.3: > - Performance, memory management, and object finalization improvements. > - GLib.ExceptionManager to support exception handling in signal > callbacks. > - GLib.IOChannel and GLib.Spawn classes for process spawning. > - Numerous bugfixes > > Thanks to the contributors to this release: Wade Berrier, Eskil Bylund, > Sebastian Dr?ge, Michael Hutchinson, Peter Johanson, Lluis Sanchez Gaul, > and myself. > > Discussion of Gtk# occurs on gtk-sharp-list at lists.ximian.com and defects > can be reported to bugzilla.novell.com, module gtk#. > > -- > Mike Kestner > > > > ------------------------------ > > Message: 3 > Date: Wed, 13 Feb 2008 14:51:10 -0600 > From: Mike Kestner > Subject: Re: [Gtk-sharp-list] [Mono-dev] Announcing Gtk# release > 2.10.3 and Gnome# release 2.16.1 > To: Vladimir Dimitrov > Cc: 'gtk-sharp-list' , > mono-devel-list at lists.ximian.com > Message-ID: <1202935870.4093.50.camel at t61p.site> > Content-Type: text/plain > > > On Wed, 2008-02-13 at 22:17 +0200, Vladimir Dimitrov wrote: > > Hello, > > Sorry about the stupid question but why would I use Gtk# 2.8.5 when > > there is Gtk# 2.10.3??? Is there any other reason than that I cannot > > reference and build apps against older versions of Gtk# if I don't > > have them installed (policies didn't work for me with VS 2005) > > > It was released for support of older platforms which are built on gtk+ > version 2.8 and therefore cannot provide Gtk# 2.10.x. > > If all the platforms you want to support ship gtk+-2.10.0 or later > versions, Gtk# 2.10.3 is probably what you want. Our windows > installers both provide 2.10.x currently. > > -- > Mike Kestner > > > > ------------------------------ > > Message: 4 > Date: Thu, 14 Feb 2008 15:27:40 +0800 > From: Marc Glenn > Subject: [Gtk-sharp-list] How to Get Row Values from a TreeView > To: gtk-sharp-list at lists.ximian.com > Message-ID: <47B3ED6C.8060908 at mnl.ntsp.nec.co.jp> > C