From pauldbourke at gmail.com Wed Jan 2 11:56:02 2008 From: pauldbourke at gmail.com (Paul Bourke) Date: Wed, 2 Jan 2008 16:56:02 +0000 Subject: [Gtk-sharp-list] Treeview question (controlling the model using a TreeModel) In-Reply-To: References: <2563cc910712301501x4b6ac46fj3f6b618b35fa600b@mail.gmail.com> Message-ID: <2563cc910801020856t6f952c06ycdfe387ae7d772a6@mail.gmail.com> I pasted the code badly.. maybe I can simplify my question a little as would really like to get this working: Basically if you check out the piece of the tutorial here: http://www.mono-project.com/GtkSharp_TreeView_Tutorial#Controlling_how_the_model_is_used it describes how to set up a TreeView so that it is bound to an object containing your data. When the data in your object changes, so does the TreeView thus allowing you to update the data easily. My problem is that the example uses a ListModel rather than a TreeModel as in the previous section (http://www.mono-project.com/GtkSharp_TreeView_Tutorial#Your_first_TreeView). If anyone has any examples of how to do this above using a TreeModel I would greatly appreciate it. On 31/12/2007, Michael Hutchinson wrote: > On Dec 30, 2007 6:01 PM, Paul Bourke wrote: > ... > > System.InvalidCastException: Cannot cast from source type to destination type. > > at GRapid.MainWindow.RenderURLColumn (Gtk.TreeViewColumn column, > ... > > TreeStore myTreeStore = new TreeStore (typeof(string), typeof (MyClass)); > ... > The two store columns have type string and MyClass, > > > DownloadItem d = (DownloadItem) model.GetValue (iter, 0); > > but you're trying to cast the string to a DownloadItem. > > -- > Michael Hutchinson > http://mjhutchinson.com > From adam at morrison-ind.com Wed Jan 2 14:15:22 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Wed, 02 Jan 2008 14:15:22 -0500 Subject: [Gtk-sharp-list] Treeview question (controlling the model using a TreeModel) In-Reply-To: <2563cc910801020856t6f952c06ycdfe387ae7d772a6@mail.gmail.com> References: <2563cc910712301501x4b6ac46fj3f6b618b35fa600b@mail.gmail.com> <2563cc910801020856t6f952c06ycdfe387ae7d772a6@mail.gmail.com> Message-ID: <1199301322.5916.6.camel@WM_ADAM1.morrison.iserv.net> > it describes how to set up a TreeView so that it is bound to an > object containing your data. When the data in your object changes, so > does the TreeView thus allowing you to update the data easily. > My problem is that the example uses a ListModel rather than a > TreeModel as in the previous section > (http://www.mono-project.com/GtkSharp_TreeView_Tutorial#Your_first_TreeView). > If anyone has any examples of how to do this above using a TreeModel I > would greatly appreciate it. I guess I don't understand the question. Where did you get "ListModel" from? It isn't anywhere in the provided examples, you attach a ListStore to a TreeModel, and just have a TreeView with only one 'level'. Gtk.TreeView tree = new Gtk.TreeView (); Gtk.ListStore musicListStore = new Gtk.ListStore (typeof (string), typeof (string)); ... tree.AppendColumn ("Artist", new Gtk.CellRendererText (), "text", 0); tree.AppendColumn ("Title", new Gtk.CellRendererText (), "text", 1); musicListStore.AppendValues ("Garbage", "Dog New Tricks"); tree.Model = musicListStore; <-- Model is the the ListStore ListStore & TreeStore should be able to be used pretty much interchangeably AFAIK, depending on the need of the application Admittedly, TreeView is an intimidating beast. -------------- 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/20080102/72d14262/attachment.bin From miltondp at gmail.com Thu Jan 3 13:26:47 2008 From: miltondp at gmail.com (Milton Pividori) Date: Thu, 03 Jan 2008 16:26:47 -0200 Subject: [Gtk-sharp-list] Treeview question (controlling the model using a TreeModel) In-Reply-To: <2563cc910801020856t6f952c06ycdfe387ae7d772a6@mail.gmail.com> References: <2563cc910712301501x4b6ac46fj3f6b618b35fa600b@mail.gmail.com> <2563cc910801020856t6f952c06ycdfe387ae7d772a6@mail.gmail.com> Message-ID: <1199384807.6281.2.camel@wasabi> Here is an example. I think I understood your problem: ------ using System; using Gtk; public partial class MainWindow: Gtk.Window { public MainWindow (): base (Gtk.WindowType.Toplevel) { Build (); Gtk.TreeViewColumn artistColumn = new Gtk.TreeViewColumn (); artistColumn.Title = "Artist"; Gtk.CellRendererText artistNameCell = new Gtk.CellRendererText (); artistColumn.PackStart (artistNameCell, true); Gtk.TreeViewColumn songColumn = new Gtk.TreeViewColumn (); songColumn.Title = "Song Title"; Gtk.CellRendererText songTitleCell = new Gtk.CellRendererText (); songColumn.PackStart (songTitleCell, true); tree.AppendColumn (artistColumn); tree.AppendColumn (songColumn); artistColumn.SetCellDataFunc(artistNameCell, new TreeCellDataFunc(this.RenderArtistName)); songColumn.SetCellDataFunc(songTitleCell, new TreeCellDataFunc(this.RenderSongTitle)); /* I save the song and genre */ Gtk.TreeStore musicListStore = new Gtk.TreeStore (typeof (Song), typeof(string)); Gtk.TreeIter iter = musicListStore.AppendValues(null, "Dance"); musicListStore.AppendValues (iter, new Song("Fannypack", "Nu Nu (Yeah Yeah) (double j and haze radio edit)")); iter = musicListStore.AppendValues (null, "Hip-hop"); musicListStore.AppendValues (iter, new Song("Nelly", "Country Grammer")); tree.Model = musicListStore; } private void RenderArtistName (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { Song song = model.GetValue (iter, 0) as Song; /* If song is null, then this is the parent iter */ if (song == null) { string s = model.GetValue(iter, 1).ToString(); (cell as Gtk.CellRendererText).Text = s; } else (cell as Gtk.CellRendererText).Text = song.Artist; } private void RenderSongTitle (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter) { Song song = model.GetValue (iter, 0) as Song; if (song == null) (cell as Gtk.CellRendererText).Text = ""; else (cell as Gtk.CellRendererText).Text = song.Title; } protected void OnDeleteEvent (object sender, DeleteEventArgs a) { Application.Quit (); a.RetVal = true; } } public class Song { public Song (string artist, string title) { this.Artist = artist; this.Title = title; } public string Artist; public string Title; } ------ Is this what you want to do? On Wed, 2008-01-02 at 16:56 +0000, Paul Bourke wrote: > I pasted the code badly.. maybe I can simplify my question a little as > would really like to get this working: > Basically if you check out the piece of the tutorial here: > http://www.mono-project.com/GtkSharp_TreeView_Tutorial#Controlling_how_the_model_is_used > it describes how to set up a TreeView so that it is bound to an > object containing your data. When the data in your object changes, so > does the TreeView thus allowing you to update the data easily. > My problem is that the example uses a ListModel rather than a > TreeModel as in the previous section > (http://www.mono-project.com/GtkSharp_TreeView_Tutorial#Your_first_TreeView). > If anyone has any examples of how to do this above using a TreeModel I > would greatly appreciate it. > > On 31/12/2007, Michael Hutchinson wrote: > > On Dec 30, 2007 6:01 PM, Paul Bourke wrote: > > ... > > > System.InvalidCastException: Cannot cast from source type to destination type. > > > at GRapid.MainWindow.RenderURLColumn (Gtk.TreeViewColumn column, > > ... > > > TreeStore myTreeStore = new TreeStore (typeof(string), typeof (MyClass)); > > ... > > The two store columns have type string and MyClass, > > > > > DownloadItem d = (DownloadItem) model.GetValue (iter, 0); > > > > but you're trying to cast the string to a DownloadItem. > > > > -- > > Michael Hutchinson > > http://mjhutchinson.com > > > _______________________________________________ > 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 adam at morrison-ind.com Fri Jan 4 16:54:06 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Fri, 04 Jan 2008 16:54:06 -0500 Subject: [Gtk-sharp-list] Preventing Dups In a ListStore Message-ID: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> I have a ListStore - panelStore = new Gtk.ListStore (typeof (Whitemice.ZOGI.Entity)); - used to hole a collection of participants. In the UI the user can search for additional participants in a dialog which then puts the selected participants into the list; all good. But what is the simplest / most efficient way to prevent dups in a ListStore? I don't want to have the same entity added twice, if it is already there I'd prefer to just ignore the operation. Like - if (!(panelStore.Contains(entity))) panelStore.AppendValues(entity); - but, of course, there is no Contains [or equivalent] method in a ListStore. And the ListStore doesn't seem to care about storing multiple references to an object. Do I need to iterate the contents every time I add an object in order to prevent dups? Or is there some kind of short-cut that I'm missing? -------------- 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/20080104/0b1f42b0/attachment.bin From m.j.hutchinson at gmail.com Fri Jan 4 19:36:25 2008 From: m.j.hutchinson at gmail.com (Michael Hutchinson) Date: Fri, 4 Jan 2008 19:36:25 -0500 Subject: [Gtk-sharp-list] Preventing Dups In a ListStore In-Reply-To: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> Message-ID: On Jan 4, 2008 4:54 PM, Adam Tauno Williams wrote: > I have a ListStore - > panelStore = new Gtk.ListStore (typeof (Whitemice.ZOGI.Entity)); > - used to hole a collection of participants. In the UI the user can > search for additional participants in a dialog which then puts the > selected participants into the list; all good. But what is the > simplest / most efficient way to prevent dups in a ListStore? I don't > want to have the same entity added twice, if it is already there I'd > prefer to just ignore the operation. > > Like - > > if (!(panelStore.Contains(entity))) panelStore.AppendValues(entity); > > - but, of course, there is no Contains [or equivalent] method in a > ListStore. And the ListStore doesn't seem to care about storing > multiple references to an object. > > Do I need to iterate the contents every time I add an object in order to > prevent dups? Or is there some kind of short-cut that I'm missing? AFAIK you'd have to iterate it (though ForEach will simplify this). Of course, that's what a Contains () call would do anyway -- if you want O(1) contains calls, you'd need a hashtable, but a list obviously needs... a list. Depending on the details of the code, storing a separate hashtable for these lookups might or might not be more efficient. Alternatively you could implement a TreeModel interface around another collection, but that would require GTK# from SVN for GInterface support. -- Michael Hutchinson http://mjhutchinson.com From felipe.lessa at gmail.com Fri Jan 4 20:31:10 2008 From: felipe.lessa at gmail.com (Felipe Lessa) Date: Fri, 4 Jan 2008 23:31:10 -0200 Subject: [Gtk-sharp-list] Preventing Dups In a ListStore In-Reply-To: References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> Message-ID: On Jan 4, 2008 10:36 PM, Michael Hutchinson wrote: > AFAIK you'd have to iterate it (though ForEach will simplify this). Of > course, that's what a Contains () call would do anyway -- if you want > O(1) contains calls, you'd need a hashtable, but a list obviously > needs... a list. Yes, that's the problem. It would be O(n) for a na?ve approach. Another option (besides hashtables, trees, etc) would be to store an additional field on each entity stating that it was already included or not, but of course this depends on how your code works, as it may be not possible. -- Felipe. From ruzyczka at versanet.de Sat Jan 5 11:06:54 2008 From: ruzyczka at versanet.de (Jacek Ruzyczka) Date: Sat, 5 Jan 2008 17:06:54 +0100 Subject: [Gtk-sharp-list] Data-Bound TreeView In-Reply-To: References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <200801051706.59434.ruzyczka@versanet.de> Hi folks, for the ongoing effort to develop data-bound Gtk# objects, I have some remark when it comes to data-binding a TreeView: When storing a tree data structure in an RDBMS, you would normally define a table like this: CREATE TABLE treestore ( id INTEGER NOT NULL PRIMARY KEY, super_id INTEGER REFERENCES treestore (id) ON DELETE CASCADE, name VARCHAR (35) ); This means: A line in this table, which has super_id = NULL, represents a root node, otherwise it would represent a "branch" (if some other line points at it with its super_id entry), or a "leaf" (otherwise). When pouring such data into the TreeView, you start with root nore #1, then with the first child node of root node #1, and so on...recursively. Once you have added all leafs, you would return to the level just above it (a node can have more than one child) and at last to the root level to continue with root #2, if it exists: + root_1 +- branch_11 |+- leaf_111 |+- leaf_112 +- branch_12 |+- leaf_121 + root_2 [...] Nowadays, you use the TreeView, associate a TreeStore with it as a model, and then recursively call the AppendValues() method on the TreeStore, using the TreeIter object returned by this method. The two big challenges I have expected so far are: *) The result set must come pre-sorted from the RDBMS (in the manner stated above), otherwise my C# app would have to scan through the result set, which consumes a lot of client-side computing time. Pre-sorting is easy with two hierarchy levels (root, leaf), but with three or four levels, you have to rely on stored procedures on RDBMS side, which are normally NOT portable. *) The TreeIters of all objects have to be stored in a collection and, when some node gets a child node, retrieved. Shall those of you who are now involved in coding the data-bound Gtk# widgets use this as a starting point. Comments and questions are, of course, always welcome. Regards Jacek Ru?yczka -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080105/fa4de302/attachment.bin From adam at morrison-ind.com Sat Jan 5 18:46:39 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Sat, 05 Jan 2008 18:46:39 -0500 Subject: [Gtk-sharp-list] Preventing Dups In a ListStore In-Reply-To: References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> Message-ID: <1199576799.12406.46.camel@aleph.morrison.iserv.net> > On Jan 4, 2008 10:36 PM, Michael Hutchinson wrote: > > AFAIK you'd have to iterate it (though ForEach will simplify this). Of > > course, that's what a Contains () call would do anyway -- if you want > > O(1) contains calls, you'd need a hashtable, but a list obviously > > needs... a list. > Yes, that's the problem. It would be O(n) for a na?ve approach. I've made a, probably rather crude, solution by extending ListStore. I had hoped to just override AppendValues but those methods aren't virtual. So I went with the keep-an-index approach. http://consonance.googlecode.com/svn/trunk/Whitemice.ZOGI.Gtk/General/Lists/EntityStore.cs Comments welcome. > Another option (besides hashtables, trees, etc) would be to store an > additional field on each entity stating that it was already included > or not, but of course this depends on how your code works, as it may > be not possible. An object can appear in perhaps dozens of lists, so that wouldn't really work. -------------- 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/20080105/636d5b59/attachment.bin From adam at morrison-ind.com Sat Jan 5 18:49:44 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Sat, 05 Jan 2008 18:49:44 -0500 Subject: [Gtk-sharp-list] Data-Bound TreeView In-Reply-To: <200801051706.59434.ruzyczka@versanet.de> References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> <200801051706.59434.ruzyczka@versanet.de> Message-ID: <1199576984.12406.49.camel@aleph.morrison.iserv.net> > for the ongoing effort to develop data-bound Gtk# objects, I have some remark > when it comes to data-binding a TreeView: > When storing a tree data structure in an RDBMS, you would normally define a > table like this: > CREATE TABLE treestore ( > id INTEGER NOT NULL PRIMARY KEY, > super_id INTEGER REFERENCES treestore (id) ON DELETE CASCADE, > name VARCHAR (35) > ); > This means: A line in this table, which has super_id = NULL, represents a root > node, otherwise it would represent a "branch" (if some other line points at > it with its super_id entry), or a "leaf" (otherwise). When using a TreeView to display data from an RDBMC I think it is much more common that the subordinate entries are the result of a foreign key relation (join or secondary select). -- Consonance: an Open Source .NET OpenGroupware client. Contact:awilliam at whitemiceconsulting.com http://freshmeat.net/projects/consonance/ -------------- 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/20080105/e5ffe0b4/attachment.bin From felipe.lessa at gmail.com Sat Jan 5 19:51:19 2008 From: felipe.lessa at gmail.com (Felipe Lessa) Date: Sat, 5 Jan 2008 22:51:19 -0200 Subject: [Gtk-sharp-list] Preventing Dups In a ListStore In-Reply-To: <1199576799.12406.46.camel@aleph.morrison.iserv.net> References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> <1199576799.12406.46.camel@aleph.morrison.iserv.net> Message-ID: On Jan 5, 2008 9:46 PM, Adam Tauno Williams wrote: > I've made a, probably rather crude, solution by extending ListStore. I > had hoped to just override AppendValues but those methods aren't > virtual. So I went with the keep-an-index approach. > > http://consonance.googlecode.com/svn/trunk/Whitemice.ZOGI.Gtk/General/Lists/EntityStore.cs > > Comments welcome You may want to make it generic instead of specific to Whitemice.ZOGI.Entity. -- Felipe. From ruzyczka at versanet.de Sun Jan 6 11:21:21 2008 From: ruzyczka at versanet.de (Jacek Ruzyczka) Date: Sun, 6 Jan 2008 17:21:21 +0100 Subject: [Gtk-sharp-list] Data-Bound TreeView In-Reply-To: <1199576984.12406.49.camel@aleph.morrison.iserv.net> References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> <200801051706.59434.ruzyczka@versanet.de> <1199576984.12406.49.camel@aleph.morrison.iserv.net> Message-ID: <200801061721.24984.ruzyczka@versanet.de> Am Sonntag, 6. Januar 2008 00:49 schrieb Adam Tauno Williams: > When using a TreeView to display data from an RDBMC I think it is much > more common that the subordinate entries are the result of a foreign key > relation (join or secondary select). > This is what I have in fact sketched here. Typically, when you have a hierarchy of categories, you would add an FK column pointing to the PK column in the same table. Regards Jacek Ru?yczka -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080106/f7705f64/attachment.bin From christian.hergert at gmail.com Sun Jan 6 13:49:04 2008 From: christian.hergert at gmail.com (Christian Hergert) Date: Sun, 6 Jan 2008 10:49:04 -0800 Subject: [Gtk-sharp-list] Data-Bound TreeView In-Reply-To: <200801061721.24984.ruzyczka@versanet.de> References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> <200801051706.59434.ruzyczka@versanet.de> <1199576984.12406.49.camel@aleph.morrison.iserv.net> <200801061721.24984.ruzyczka@versanet.de> Message-ID: <6d4a25b10801061049o2396951eu2566f1e6bc1036fa@mail.gmail.com> Just a heads up for whoever is thinking about doing this. I've written stuff like this in both python and C and noticed some interesting results. First of all, I went the route of writing a custom GtkTreeModel. This way I had full control of tree iteration. You will probably want to do the same. Especially since this allows lazy loading. For example: For the iter data, you could store the rows offset. In PostgreSQL and SQLite, using the row OID works great as it is the fastest way to access any record. However, using a system that allows you to determine the next rows Iter data without a new query is probably a good idea. If I remember correctly, I got my best performance by mixing the two ideas; Batching queries to get the next 10 rows OIDs. I also noticed that for some reason, when setting the model, a GtkTreeView will try to scan the entire result set. I think this is actually a GtkCellRendererText trying to figure out sizing but I haven't looked at it too closely. You also may want a tunable cache to lower the number of queries. I used a LRU which worked pretty decently . Just remember to expire values on updates. Food for thought. -- Christian On Jan 6, 2008 8:21 AM, Jacek Ruzyczka wrote: > Am Sonntag, 6. Januar 2008 00:49 schrieb Adam Tauno Williams: > > When using a TreeView to display data from an RDBMC I think it is much > > more common that the subordinate entries are the result of a foreign key > > relation (join or secondary select). > > > This is what I have in fact sketched here. Typically, when you have a > hierarchy of categories, you would add an FK column pointing to the PK column > in the same table. > > Regards > Jacek Ru?yczka > > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > From ruzyczka at versanet.de Tue Jan 8 10:24:55 2008 From: ruzyczka at versanet.de (Jacek Ruzyczka) Date: Tue, 8 Jan 2008 16:24:55 +0100 Subject: [Gtk-sharp-list] Data-Bound TreeView In-Reply-To: <6d4a25b10801061049o2396951eu2566f1e6bc1036fa@mail.gmail.com> References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> <200801061721.24984.ruzyczka@versanet.de> <6d4a25b10801061049o2396951eu2566f1e6bc1036fa@mail.gmail.com> Message-ID: <200801081624.59218.ruzyczka@versanet.de> Am Sonntag, 6. Januar 2008 19:49 schrieb Christian Hergert: > First of all, I went the route of writing a custom GtkTreeModel. This > way I had full control of tree iteration. You will probably want to > do the same. Especially since this allows lazy loading. > The reason why I used a pre-sorted query is that the sorting function for the tree view nodes is then executed in the RDBMS, which in turn lowers some CPU burden on the client side. The drawback of my solution, of course, is that it's no longer DBMS-independent because of the stored procedure. :-( > For example: For the iter data, you could store the rows offset. In > PostgreSQL and SQLite, using the row OID works great as it is the > fastest way to access any record. However, using a system that allows > you to determine the next rows Iter data without a new query is > probably a good idea. If I remember correctly, I got my best > performance by mixing the two ideas; Batching queries to get the next > 10 rows OIDs. > DANGER: The newest PostgreSQL releases assign OIDs to individual rows only when you request it in the CREATE TABLE command. > You also may want a tunable cache to lower the number of queries. I > used a LRU which worked pretty decently . Just remember to expire > values on updates. > That's a good thing as you never know what the LAN performance of your customers is. :-/ Regards Jacek -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080108/ff1dc26a/attachment-0001.bin From serickson at isillc.com Tue Jan 8 14:21:47 2008 From: serickson at isillc.com (Stephen Erickson) Date: Tue, 08 Jan 2008 13:21:47 -0600 Subject: [Gtk-sharp-list] Gnome Vfs Bindings question Message-ID: <1199820107.9228.11.camel@station-13.ad.isillc.com> Long and short is that I'm trying to get the MIME type from a known uri string and the Gnome.Vfs.FileInfo class found in gnome-vfs-sharp looked to be the ticket. (I'm wanting something that will/should work under both windows & linux.) Unfortunately, when I try to run the following code: Gnome.Vfs.FileInfo info = new Gnome.Vfs.FileInfo(fileUri, FileInfoOptions.GetMimeType); where fileUri is a string version of the uri I get a VfsException that says Invalid parameters. The inner exception is set to null. I did see an example floating around the Net that had FileInfoOptions.Default | FileInfoOptions.GetMimeType, but trying that gave the same results. Does this mean that GetMimeType is not actually supported or am I missing something? I'm running Gtk# for Windows v2.8 Thanks! -Stephen Erickson From adam at morrison-ind.com Tue Jan 8 16:02:24 2008 From: adam at morrison-ind.com (Adam Tauno Williams) Date: Tue, 08 Jan 2008 16:02:24 -0500 Subject: [Gtk-sharp-list] Data-Bound TreeView In-Reply-To: <200801081624.59218.ruzyczka@versanet.de> References: <1199483646.6049.12.camel@WM_ADAM1.morrison.iserv.net> <200801061721.24984.ruzyczka@versanet.de> <6d4a25b10801061049o2396951eu2566f1e6bc1036fa@mail.gmail.com> <200801081624.59218.ruzyczka@versanet.de> Message-ID: <1199826144.9131.7.camel@WM_ADAM1.morrison.iserv.net> > > For example: For the iter data, you could store the rows offset. In > > PostgreSQL and SQLite, using the row OID works great as it is the > > fastest way to access any record. However, using a system that allows > > you to determine the next rows Iter data without a new query is > > probably a good idea. If I remember correctly, I got my best > > performance by mixing the two ideas; Batching queries to get the next > > 10 rows OIDs. I'd hope that any Gtk# data-binding would be binding to an ADO.Net DataSet/DataTable and not dealing with any specific providers. DataTable provides a primary key property, IMO, nothing should depend on anything except that; that and the ChildRelations / ParentRelations seem adequate to automatically fill a TreeView; although I still doubt anyone [in practice] is actually using a TreeView in such a straight-forward way - Entities, Labels, and ComboBoxs probably, but TreeViews I see are usually of some kind of composite/tabulated data. -------------- 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/20080108/600dc88a/attachment.bin From wberrier at novell.com Wed Jan 9 14:29:44 2008 From: wberrier at novell.com (Wade Berrier) Date: Wed, 09 Jan 2008 12:29:44 -0700 Subject: [Gtk-sharp-list] Gtk.Action Message-ID: <1199906984.5484.11.camel@wberrier.site> Hi, I've recently noticed some build errors for monodevelop. This is building on suse 10.1 with gtk# 2.8: /MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs(230,33): error CS0104: `Action' is an ambiguous reference between `System.Action' and `Gtk.Action' With this change in place, am I still going to be able to build on suse 10.1 with gtk# 2.8? Will gtk# 2.8 need an update to reflect this change? FYI, the reason I build on 10.1 is for the binary linux installer. Even still, I assume we still want to support some older distros that are still in service? Wade -------------- 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/20080109/a993c70c/attachment.bin From vladimir.giszpenc at gmail.com Fri Jan 11 10:07:10 2008 From: vladimir.giszpenc at gmail.com (Vladimir Giszpenc) Date: Fri, 11 Jan 2008 10:07:10 -0500 Subject: [Gtk-sharp-list] Why(Gtk# + threading != responsive GUI) Message-ID: <8ed5cbac0801110707r6699e678j2d230dbe408b8d4b@mail.gmail.com> Hi all, My (Gtk#) GUI thread is non-responsive and I am hoping to find a profiler or something else that will help me figure out why that is. I am creating a worker thread (a.k.a. long running process) as described below. Note that I set the priority to Lowest for my worker but it seems to take over the processor anyway. Are there any obvious tips I can try to follow? Is there a profiler that will run on Linux? I run Mono on OpenSuse 10.2 and all the C# profilers seem to be written for Windows. I tried using the profiler that is part of Mono but I don't know how to read (analyse) the output. Is there any help? Evaluator eval = new Evaluator(); ThreadStart ts = new ThreadStart(eval.Run); Thread evalHost = new Thread(ts); evalHost.IsBackground = true; evalHost.Priority = ThreadPriority.Lowest; evalHost.Name = "Foo"; evalHost.Start(); System.Threading.Interlocked.Increment(ref workersLeft); Thanks, Vlad From latexer at gentoo.org Fri Jan 11 11:14:25 2008 From: latexer at gentoo.org (Peter Johanson) Date: Fri, 11 Jan 2008 08:14:25 -0800 Subject: [Gtk-sharp-list] Why(Gtk# + threading != responsive GUI) In-Reply-To: <8ed5cbac0801110707r6699e678j2d230dbe408b8d4b@mail.gmail.com> References: <8ed5cbac0801110707r6699e678j2d230dbe408b8d4b@mail.gmail.com> Message-ID: <20080111161425.GB20863@butchest.cubesearch.com> On Fri, Jan 11, 2008 at 10:07:10AM -0500, Vladimir Giszpenc wrote: > Hi all, > > My (Gtk#) GUI thread is non-responsive and I am hoping to find a > profiler or something else that will help me figure out why that is. > I am creating a worker thread (a.k.a. long running process) as > described below. Note that I set the priority to Lowest for my worker > but it seems to take over the processor anyway. > > Are there any obvious tips I can try to follow? Have you read http://mono-project.com/Responsive_Applications yet? gtk+ is thread aware, but not thread safe. In order to behave properly, you can only mess with GUI bits from within the gtk+ mainloop context. The above URL has a lot of pointers for approaches for doing this properly. -pete From mjamon at ntsp.nec.co.jp Fri Jan 18 03:53:04 2008 From: mjamon at ntsp.nec.co.jp (Marc Glenn) Date: Fri, 18 Jan 2008 16:53:04 +0800 Subject: [Gtk-sharp-list] unknown widget class 'GtkFileChooserWidget' Message-ID: <479068F0.4040704@mnl.ntsp.nec.co.jp> Hello guys, We tried using save dialog box in Glade-3.4 and compile it under Mono( gtk-sharp ). This dialog box contains GtkFileChooserWidget widget. Compilation was successful but upon running the application and as the save dialog box showed,the filechooser widget was not present and an error in the console was displayed. This was the error: (DebugTool:3980): libglade-WARNING **: unknown widget class 'GtkFileChooserWidget' We are using Glade-3.4 gtk-sharp-2.10 mono-1.2.5.1 Anyone experienced this problem before? THanks in advance From elmar at haneke.de Fri Jan 18 04:54:33 2008 From: elmar at haneke.de (Elmar Haneke) Date: Fri, 18 Jan 2008 10:54:33 +0100 Subject: [Gtk-sharp-list] TreeViewColumn - Attibutes Message-ID: <47907759.6040705@haneke.de> Hi, how can I read attributes set by TreeViewColumn.AddAttribute? Elmar From lordphoenix at free.fr Fri Jan 18 05:07:01 2008 From: lordphoenix at free.fr (lordphoenix) Date: Fri, 18 Jan 2008 11:07:01 +0100 Subject: [Gtk-sharp-list] How to set a "null" value in a spinbutton Message-ID: <1200650821.6272.5.camel@jupiter> Hi, I would like users of my application can drop content of a spinbutton to set a null value but each time the value is set to "0" when lost focus. I can do it in code but in this particular case it's not really a very good solution. Anyone has an idea? PS : Sorry for my bad English I don't speak it very often :) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?= Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080118/eed05346/attachment.bin From trupill at yahoo.es Sun Jan 20 10:44:14 2008 From: trupill at yahoo.es (Alejandro Serrano) Date: Sun, 20 Jan 2008 16:44:14 +0100 Subject: [Gtk-sharp-list] Gapi2 Exception Message-ID: <1200843854.6097.3.camel@serras-laptop> Hi, I'm trying to produce bindings for the GooCanvas widget. After doing some efforts reordering the source code from GooCanvas, I've came to the moment of generating the code based on the api file. However, when I run gapi2-codegen, I get the following exception: Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required. at GtkSharp.Generation.Property.Generate (GtkSharp.Generation.GenerationInfo gen_info, System.String indent, GtkSharp.Generation.ClassBase implementor) [0x00000] at GtkSharp.Generation.ClassBase.GenProperties (GtkSharp.Generation.GenerationInfo gen_info, GtkSharp.Generation.ClassBase implementor) [0x00000] at GtkSharp.Generation.ObjectGen.Generate (GtkSharp.Generation.GenerationInfo gen_info) [0x00000] at GtkSharp.Generation.CodeGenerator.Main (System.String[] args) [0x00000] Can I do something for successfully generating the C# code? Thanks in advance, Alejandro PS: I attach the file I want to generate the code from. -------------- next part -------------- A non-text attachment was scrubbed... Name: goocanvas.gapi.gz Type: application/x-gzip Size: 7806 bytes Desc: not available Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080120/77be6c27/attachment-0001.gz From hellboy195 at gmail.com Mon Jan 21 11:58:22 2008 From: hellboy195 at gmail.com (hellboy195) Date: Mon, 21 Jan 2008 08:58:22 -0800 (PST) Subject: [Gtk-sharp-list] Check Process state in an GUI app Message-ID: <14982013.post@talk.nabble.com> hi, I'm currently trying to write a very very simple front-end for ffmpeg with gtk#. My Code looks like this: First I check if a file already exits with File.Exits(path) MessageDialog -> Overwrite YesNO. Then the I start ffmpeg with Process.Start(). Then I want show a MessageDialog if the process finished so I did it like : while(!proc.HasExited) {} MessageDialog -> "Encoding finished"; This is working good but this causes some bugs. E.g: If I do Overwrite it "yes". The MessageDialog isn't destroyed until the process finished. If I delete this while {} it's working correct but the Message appears immediately and not after the process hast Finished. Using if is also not that good I suppose :/ Any solution? Thx in advance :) -- View this message in context: http://www.nabble.com/Check-Process-state-in-an-GUI-app-tp14982013p14982013.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From m.j.hutchinson at gmail.com Mon Jan 21 12:52:53 2008 From: m.j.hutchinson at gmail.com (Michael Hutchinson) Date: Mon, 21 Jan 2008 12:52:53 -0500 Subject: [Gtk-sharp-list] Check Process state in an GUI app In-Reply-To: <14982013.post@talk.nabble.com> References: <14982013.post@talk.nabble.com> Message-ID: On Jan 21, 2008 11:58 AM, hellboy195 wrote: > > hi, > I'm currently trying to write a very very simple front-end for ffmpeg with > gtk#. > My Code looks like this: > > First I check if a file already exits with File.Exits(path) > MessageDialog -> Overwrite YesNO. > > Then the I start ffmpeg with Process.Start(). > Then I want show a MessageDialog if the process finished so I did it like : > > while(!proc.HasExited) {} > MessageDialog -> "Encoding finished"; > > This is working good but this causes some bugs. E.g: If I do Overwrite it > "yes". The MessageDialog isn't destroyed until the process finished. If I > delete this while {} it's working correct but the Message appears > immediately and not after the process hast Finished. Using if is also not > that good I suppose :/ > > Any solution? Thx in advance :) Your loop is hanging the GUI thread, by not allowing GTK to return to its main loop (in which it does all the drawing etc). Handle the Process.Exited thread instead: proc.Exited += delegate { MessageDialog -> "Encoding finished"; }; -- Michael Hutchinson http://mjhutchinson.com From hellboy195 at gmail.com Mon Jan 21 13:26:18 2008 From: hellboy195 at gmail.com (hellboy195) Date: Mon, 21 Jan 2008 10:26:18 -0800 (PST) Subject: [Gtk-sharp-list] Check Process state in an GUI app In-Reply-To: References: <14982013.post@talk.nabble.com> Message-ID: <15003226.post@talk.nabble.com> Michael Hutchinson wrote: > > On Jan 21, 2008 11:58 AM, hellboy195 wrote: >> >> hi, >> I'm currently trying to write a very very simple front-end for ffmpeg >> with >> gtk#. >> My Code looks like this: >> >> First I check if a file already exits with File.Exits(path) >> MessageDialog -> Overwrite YesNO. >> >> Then the I start ffmpeg with Process.Start(). >> Then I want show a MessageDialog if the process finished so I did it like >> : >> >> while(!proc.HasExited) {} >> MessageDialog -> "Encoding finished"; >> >> This is working good but this causes some bugs. E.g: If I do Overwrite it >> "yes". The MessageDialog isn't destroyed until the process finished. If I >> delete this while {} it's working correct but the Message appears >> immediately and not after the process hast Finished. Using if is also not >> that good I suppose :/ >> >> Any solution? Thx in advance :) > > Your loop is hanging the GUI thread, by not allowing GTK to return to > its main loop (in which it does all the drawing etc). > > Handle the Process.Exited thread instead: > > proc.Exited += delegate { > MessageDialog -> "Encoding finished"; > }; > > -- > Michael Hutchinson > http://mjhutchinson.com > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > Hi, thank you very much for your help. I tried both of you methods and it's working really great but there is one thing left I that should work. With my old (buggy) version the Files from the Treeview were removed automatically when the encoding was finshed. That means. I have a treeview with let's say 3 titels and after the first title is finished with encoding it should be removed to only 2 are remaining and so on ... Any chance that I can manage it like in the past with? this.menuListStore.GetIterFirst(out iter); this.menuListStore.Remove(ref iter); -- View this message in context: http://www.nabble.com/Check-Process-state-in-an-GUI-app-tp14982013p15003226.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From hellboy195 at gmail.com Mon Jan 21 13:26:49 2008 From: hellboy195 at gmail.com (hellboy195) Date: Mon, 21 Jan 2008 10:26:49 -0800 (PST) Subject: [Gtk-sharp-list] Check Process state in an GUI app Message-ID: <15003226.post@talk.nabble.com> Michael Hutchinson wrote: > > On Jan 21, 2008 11:58 AM, hellboy195 wrote: >> >> hi, >> I'm currently trying to write a very very simple front-end for ffmpeg >> with >> gtk#. >> My Code looks like this: >> >> First I check if a file already exits with File.Exits(path) >> MessageDialog -> Overwrite YesNO. >> >> Then the I start ffmpeg with Process.Start(). >> Then I want show a MessageDialog if the process finished so I did it like >> : >> >> while(!proc.HasExited) {} >> MessageDialog -> "Encoding finished"; >> >> This is working good but this causes some bugs. E.g: If I do Overwrite it >> "yes". The MessageDialog isn't destroyed until the process finished. If I >> delete this while {} it's working correct but the Message appears >> immediately and not after the process hast Finished. Using if is also not >> that good I suppose :/ >> >> Any solution? Thx in advance :) > > Your loop is hanging the GUI thread, by not allowing GTK to return to > its main loop (in which it does all the drawing etc). > > Handle the Process.Exited thread instead: > > proc.Exited += delegate { > MessageDialog -> "Encoding finished"; > }; > > -- > Michael Hutchinson > http://mjhutchinson.com > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > Hi, thank you very much for your help. I tried both of you methods and it's working really great but there is one thing left that should work. With my old (buggy) version the Files from the Treeview were removed automatically when the encoding was finshed. That means. I have a treeview with let's say 3 titels and after the first title is finished with encoding it should be removed to only 2 are remaining and so on ... Any chance that I can manage it like in the past with? this.menuListStore.GetIterFirst(out iter); this.menuListStore.Remove(ref iter); -- View this message in context: http://www.nabble.com/Check-Process-state-in-an-GUI-app-tp14982013p15003226.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From cdhowie at gmail.com Mon Jan 21 14:08:50 2008 From: cdhowie at gmail.com (Chris Howie) Date: Mon, 21 Jan 2008 14:08:50 -0500 Subject: [Gtk-sharp-list] Check Process state in an GUI app In-Reply-To: <3d2f29dc0801210945x61ff344ai962a69baa0c4ec7@mail.gmail.com> References: <14982013.post@talk.nabble.com> <3d2f29dc0801210945x61ff344ai962a69baa0c4ec7@mail.gmail.com> Message-ID: <3d2f29dc0801211108s27aa0574o8aa79fe5234a7d56@mail.gmail.com> (Oops, sent this to the wrong list.) On Jan 21, 2008 12:45 PM, Chris Howie wrote: > On Jan 21, 2008 11:58 AM, hellboy195 wrote: > > hi, > > I'm currently trying to write a very very simple front-end for ffmpeg with > > gtk#. > > My Code looks like this: > > > > First I check if a file already exits with File.Exits(path) > > MessageDialog -> Overwrite YesNO. > > > > Then the I start ffmpeg with Process.Start(). > > Then I want show a MessageDialog if the process finished so I did it like : > > > > while(!proc.HasExited) {} > > MessageDialog -> "Encoding finished"; > > > > This is working good but this causes some bugs. E.g: If I do Overwrite it > > "yes". The MessageDialog isn't destroyed until the process finished. If I > > delete this while {} it's working correct but the Message appears > > immediately and not after the process hast Finished. Using if is also not > > that good I suppose :/ > > > > Any solution? Thx in advance :) > > The problem is that you are waiting for the operation to complete on > the GUI thread. You have destroyed the dialog, but Gtk cannot > actually remove the dialog from the screen until you give control back > to the main GUI loop. > > What you want to do is either add an idle handler or spin off another > thread to take care of it. An idle handler would probably be easiest > for your purpose: > > // Message dialog code > Process proc = ...; > GLib.Idle.Add(delegate { > if (proc.HasExited) { > // Show dialog. > return false; // Remove this delegate from the idle list. > } > > return true; // Run this delegate again when idle. > }); > > Note that this approach can burn quite a bit of CPU running the idle > delegate. You may want to try attaching an event handler to > Process.Exited instead: > > proc.EnableRaisingEvents = true; > proc.Exited += delegate { > Application.Invoke(delegate { > // Show dialog. > }); > }; > > Note that you must call Application.Invoke because the Exited event > handler will not be running on the GUI thread, and you should not > touch the GUI from other threads. Application.Invoke puts a delegate > in a queue to be executed on the GUI thread the next time the main > loop is entered. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From cdhowie at gmail.com Mon Jan 21 14:09:49 2008 From: cdhowie at gmail.com (Chris Howie) Date: Mon, 21 Jan 2008 14:09:49 -0500 Subject: [Gtk-sharp-list] Check Process state in an GUI app In-Reply-To: <15003226.post@talk.nabble.com> References: <14982013.post@talk.nabble.com> <15003226.post@talk.nabble.com> Message-ID: <3d2f29dc0801211109y774c3387r5b03d50140adec70@mail.gmail.com> On Jan 21, 2008 1:26 PM, hellboy195 wrote: > Hi, > thank you very much for your help. I tried both of you methods and it's > working really great but there is one thing left I that should work. With my > old (buggy) version the Files from the Treeview were removed automatically > when the encoding was finshed. That means. I have a treeview with let's say > 3 titels and after the first title is finished with encoding it should be > removed to only 2 are remaining and so on ... > Any chance that I can manage it like in the past with? > > this.menuListStore.GetIterFirst(out iter); > this.menuListStore.Remove(ref iter); You still can, you just need to do this from the GUI thread. We will need more information about the circumstances you are doing this under to help. Can you paste your code? -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From hellboy195 at gmail.com Mon Jan 21 14:34:10 2008 From: hellboy195 at gmail.com (hellboy195) Date: Mon, 21 Jan 2008 11:34:10 -0800 (PST) Subject: [Gtk-sharp-list] Check Process state in an GUI app In-Reply-To: <3d2f29dc0801211109y774c3387r5b03d50140adec70@mail.gmail.com> References: <14982013.post@talk.nabble.com> <15003226.post@talk.nabble.com> <3d2f29dc0801211109y774c3387r5b03d50140adec70@mail.gmail.com> Message-ID: <15004614.post@talk.nabble.com> Chris Howie-3 wrote: > > On Jan 21, 2008 1:26 PM, hellboy195 wrote: >> Hi, >> thank you very much for your help. I tried both of you methods and it's >> working really great but there is one thing left I that should work. With >> my >> old (buggy) version the Files from the Treeview were removed >> automatically >> when the encoding was finshed. That means. I have a treeview with let's >> say >> 3 titels and after the first title is finished with encoding it should be >> removed to only 2 are remaining and so on ... >> Any chance that I can manage it like in the past with? >> >> this.menuListStore.GetIterFirst(out iter); >> this.menuListStore.Remove(ref iter); > > You still can, you just need to do this from the GUI thread. We will > need more information about the circumstances you are doing this under > to help. Can you paste your code? > > -- > Chris Howie > http://www.chrishowie.com > http://en.wikipedia.org/wiki/User:Crazycomputers > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > Sure, no problem. Though I don't know if I should post the whole one ore not ^^. anyway. here it is : protected virtual void OnCovertClicked (object sender, System.EventArgs e) { try { this.SelectFolder.Sensitive = false; this.FileAdd.Sensitive = false; this.RemoveFile.Sensitive = false; this.ClearAll.Sensitive = false; this.entry1.Sensitive = false; this.combobox1.Sensitive = false; this.combobox2.Sensitive = false; this.menubar1.Sensitive = false; selectedFile = String.Empty; newselectedFile = String.Empty; oldselectedFile = String.Empty; while(this.menuListStore.GetIterFirst(out iter) != false) { format = this.combobox1.ActiveText; quality = this.combobox2.ActiveText; iter = new TreeIter(); menuListStore.GetIterFirst(out iter); selectedFile = (string)menuListStore.GetValue(iter, 0); if(selectedFile.Substring(selectedFile.Length -4) == "flac") number+=1; oldselectedFile = selectedFile.Replace(selectedFile.Substring(selectedFile.Length - number), format); selectedFile = selectedFile.Replace(" ", "\\ "); newselectedFile = selectedFile.Replace(selectedFile.Substring(selectedFile.Length - number), format); if(selectedFile.Substring(selectedFile.Length -4) == "flac") number-=1; string command = "ffmpeg -y -i " + selectedFile + " -ab " + quality.Replace("b/s", " ") + newselectedFile; if (System.IO.File.Exists(oldselectedFile)) { MessageDialog md = new MessageDialog (this, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.YesNo, newselectedFile + " already exits. Overwrite it?"); ResponseType result = (ResponseType)md.Run (); if (result == ResponseType.Yes) { md.Destroy(); this.Convert.Sensitive = false; proc = Process.Start(command); } else { this.FileAdd.Sensitive = true; this.Convert.Sensitive = false; md.Destroy(); } } else { this.Convert.Sensitive = false; proc = Process.Start(command); } this.menuListStore.GetIterFirst(out iter); this.menuListStore.Remove(ref iter); } // GLib.Idle.Add(delegate { // if (proc.HasExited) { // // MessageDialog mdg = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Ok, "Encoding finished"); // mdg.Run(); // mdg.Destroy(); // // return false; // Remove this delegate from the idle list. // } // // return true; // Run this delegate again when idle. //}); proc.EnableRaisingEvents = true; proc.Exited += delegate { Application.Invoke(delegate { MessageDialog mdg = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Info, ButtonsType.Ok, "Encoding finished"); mdg.Run(); mdg.Destroy(); }); }; this.FileAdd.Sensitive = true; this.Convert.Sensitive = false; this.SelectFolder.Sensitive = true; this.entry1.Sensitive = true; this.combobox1.Sensitive = true; this.combobox2.Sensitive = true; this.menubar1.Sensitive = true; } catch(Exception ee) { Console.WriteLine(ee); } } In my eyes it's very ugly code and beside my problem here I would appreciate any suggestions ;) Thx :D -- View this message in context: http://www.nabble.com/Check-Process-state-in-an-GUI-app-tp14982013p15004614.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From cdhowie at gmail.com Mon Jan 21 14:41:34 2008 From: cdhowie at gmail.com (Chris Howie) Date: Mon, 21 Jan 2008 14:41:34 -0500 Subject: [Gtk-sharp-list] Check Process state in an GUI app In-Reply-To: <15004614.post@talk.nabble.com> References: <14982013.post@talk.nabble.com> <15003226.post@talk.nabble.com> <3d2f29dc0801211109y774c3387r5b03d50140adec70@mail.gmail.com> <15004614.post@talk.nabble.com> Message-ID: <3d2f29dc0801211141p23fae048ta8fbb07f85a93ed7@mail.gmail.com> On Jan 21, 2008 2:34 PM, hellboy195 wrote: > Sure, no problem. Though I don't know if I should post the whole one ore not > ^^. anyway. here it is : > > [snip] > > In my eyes it's very ugly code and beside my problem here I would appreciate > any suggestions ;) > Thx :D Thanks, that helped a lot. Basically, you are going to have to change your entire code flow and break it apart a bit. You are going to need one method that is responsible for checking your preconditions (popping a dialog to confirm, etc) and starting the process on one file. Then in the Exited handler you need to start the process on the next file. So something like this pseudo-code: OnConvertClicked(): ProcessNextFile(); ProcessNextFile(): CheckPreconditions; StartProcess; AttachEventHandler -> Application.Invoke -> OnProcessCompleted; OnProcessCompleted(): RemoveProcessedFileFromList; If MoreFilesToProcess ProcessNextFile(); Something like that. You may want to make your window insensitive during the processing too, or at least any buttons that can change the state of your application. You don't want people modifying the file list while you are processing, for example. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers From hellboy195 at gmail.com Mon Jan 21 15:11:57 2008 From: hellboy195 at gmail.com (hellboy195) Date: Mon, 21 Jan 2008 12:11:57 -0800 (PST) Subject: [Gtk-sharp-list] Check Process state in an GUI app In-Reply-To: <3d2f29dc0801211141p23fae048ta8fbb07f85a93ed7@mail.gmail.com> References: <14982013.post@talk.nabble.com> <15003226.post@talk.nabble.com> <3d2f29dc0801211109y774c3387r5b03d50140adec70@mail.gmail.com> <15004614.post@talk.nabble.com> <3d2f29dc0801211141p23fae048ta8fbb07f85a93ed7@mail.gmail.com> Message-ID: <15005381.post@talk.nabble.com> Chris Howie-3 wrote: > > On Jan 21, 2008 2:34 PM, hellboy195 wrote: >> Sure, no problem. Though I don't know if I should post the whole one ore >> not >> ^^. anyway. here it is : >> >> [snip] >> >> In my eyes it's very ugly code and beside my problem here I would >> appreciate >> any suggestions ;) >> Thx :D > > Thanks, that helped a lot. > > Basically, you are going to have to change your entire code flow and > break it apart a bit. You are going to need one method that is > responsible for checking your preconditions (popping a dialog to > confirm, etc) and starting the process on one file. Then in the > Exited handler you need to start the process on the next file. So > something like this pseudo-code: > > OnConvertClicked(): > ProcessNextFile(); > > ProcessNextFile(): > CheckPreconditions; > StartProcess; > AttachEventHandler -> Application.Invoke -> OnProcessCompleted; > > OnProcessCompleted(): > RemoveProcessedFileFromList; > If MoreFilesToProcess > ProcessNextFile(); > > Something like that. You may want to make your window insensitive > during the processing too, or at least any buttons that can change the > state of your application. You don't want people modifying the file > list while you are processing, for example. > > -- > Chris Howie > http://www.chrishowie.com > http://en.wikipedia.org/wiki/User:Crazycomputers > _______________________________________________ > Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com > http://lists.ximian.com/mailman/listinfo/gtk-sharp-list > > You are helping me a lot. Thank you very much. Yeah as you can see I already tried to set all buttons,.. insensetive. Thx for you posted solution but I'm totally new to this. Can you give me a more specific code? Unfortunately the docs are really really *unfilled* I wouldn't ask -- View this message in context: http://www.nabble.com/Check-Process-state-in-an-GUI-app-tp14982013p15005381.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From aliencode at sapo.pt Tue Jan 22 09:26:50 2008 From: aliencode at sapo.pt (aliencode at sapo.pt) Date: Tue, 22 Jan 2008 14:26:50 +0000 Subject: [Gtk-sharp-list] Gtk# help Message-ID: <20080122142650.87sdg2beroc4kkgs@w10.mail.sapo.pt> Hi everybody I need some help, i am creating an application using mono (obvious :P ) and i need to create have a widget with background image and on top of it will be a table layout. After that i need to add this widget on the main window. I already solve the problem for the background image but when its loaded it fill all the main window background too. so what i would like to have is the new widget as a utility bar. My code for the backgound that i want to attach to the main window public partial class frmFretboard : Gtk.Window { public frmFretboard(): base(Gtk.WindowType.Popup) { this.Build(); // Gtk.Style wndStyle; // wndStyle = new Gtk.Style(); this.Style.BgPixmap( StateType.Normal ); try { Gdk.Pixbuf image = new Gdk.Pixbuf( "guitarfretboard.jpg" ); Gdk.Pixmap pixmap, pixmap_mask; image.RenderPixmapAndMask( out pixmap, out pixmap_mask, 255 ); int width = image.Width; int height = image.Height; this.Style.SetBgPixmap(StateType.Normal,pixmap ); this.SetSizeRequest(width,height); this.Resize(width,height); } catch(System.Exception e) { MessageBox msg = new MessageBox(); msg.Show(e.Message); Application.Quit(); } } } The next code is the widget i created where the first will be attached and then this one will be attached to the main window. public partial class FretBoard : Gtk.Bin { private Widget fretboard; public FretBoard() { this.Build(); Added += new AddedHandler (OnWidgetAdded); SizeRequested += new SizeRequestedHandler (OnSizeRequested); SizeAllocated += new SizeAllocatedHandler (OnSizeAllocated); // fretboard = new frmFretboard(); this.Add(new frmFretboard()); } public void SetStringPressed( int pos_x, int pos_y ) { //tblFretboard.Attach(); } void OnWidgetAdded (object o, AddedArgs args) { fretboard = args.Widget; } void OnSizeRequested (object o, SizeRequestedArgs args) { if (fretboard != null) { int width = args.Requisition.Width; int height = args.Requisition.Height; fretboard.GetSizeRequest (out width, out height); if (width == -1 || height == -1) width = height = 80; SetSizeRequest (width , height ); } } // // Invoked to propagate our size // void OnSizeAllocated (object o, SizeAllocatedArgs args) { if (fretboard != null){ Gdk.Rectangle mine = args.Allocation; Gdk.Rectangle his = mine; // his.X += pad; // his.Y += pad; // his.Width -= pad * 2; // his.Height -= pad * 2; fretboard.SizeAllocate (his); } } Thanks in advance. From hellboy195 at gmail.com Sun Jan 20 09:01:09 2008 From: hellboy195 at gmail.com (hellboy195) Date: Sun, 20 Jan 2008 06:01:09 -0800 (PST) Subject: [Gtk-sharp-list] Check Process state in an GUI app Message-ID: <14982013.post@talk.nabble.com> hi, I'm currently trying to write a very very simple front-end for ffmpeg with gtk#. My Code looks like this: First I check if a file already exits with File.Exits(path) MessageDialog -> Overwrite YesNO. Then the I start ffmpeg with Process.Start(). Then I want show a MessageDialog if the process finished so I did it like : while(!proc.HasExited) {} MessageDialog -> "Encoding finished"; This is working good but this causes some bugs. E.g: If I do Overwrite it "yes". The MessageDialog isn't destroyed until the process finished. If I delete this while {} it's working correct but the Message appears immediately and not after the process hast Finished. Using if is also not that good I suppose :/ Any solution? Thx in advance :) -- View this message in context: http://www.nabble.com/Check-Process-state-in-an-GUI-app-tp14982013p14982013.html Sent from the Mono - Gtk# mailing list archive at Nabble.com. From esqueleto at tusofona.com Wed Jan 23 15:22:33 2008 From: esqueleto at tusofona.com (Paulo Aboim Pinto) Date: Wed, 23 Jan 2008 20:22:33 +0000 Subject: [Gtk-sharp-list] Compile the SVN version. Need help!! Message-ID: <10b6506f0801231222g37be99bao64889100ff913aff@mail.gmail.com> Hello This is the first time I post anything to this malling list and this is my problem. When I do ./configure --prefix=/usr I get this output: --- Configuration summary * Installation prefix = /usr/ * C# compiler: /usr/bin/mcs -define:GTK_SHARP_2_6 -define:GTK_SHARP_2_8 -define:GTK_SHARP_2_10 -define:GTK_SHARP_2_12 Optional assemblies included in the build: * glade-sharp.dll: yes * gtk-dotnet.dll: yes NOTE: if any of the above say 'no' you may install the corresponding development packages for them, rerun autogen.sh to include them in the build. * Documentation build enabled: yes WARNING: The install prefix is different than the monodoc prefix. Monodoc will not be able to load the documentation. --- When I make I get this error after a summary: cp ../gtk-sharp.snk . cp ../AssemblyInfo.cs . /usr/bin/mcs -define:GTK_SHARP_2_6 -define:GTK_SHARP_2_8 -define:GTK_SHARP_2_10 -define:GTK_SHARP_2_12 -nowarn:0169,0612,0618 -unsafe -out:gtk-sharp.dll -target:library /r:../glib/glib-sharp.dll/r:../pango/pango- sharp.dll /r:../atk/atk-sharp.dll /r:../gdk/gdk-sharp.dll-r:/usr/lib/pkgconfig/../../lib/mono/1.0/Mono.Cairo.dll generated/*.cs ./ActionEntry.cs ./Application.cs ./BindingAttribute.cs ./ChildPropertyAttribute.cs ./ITreeNode.cs ./NodeCellDataFunc.cs ./NodeSelection.cs ./NodeStore.cs ./NodeView.cs ./RadioActionEntry.cs ./RowsReorderedHandler.cs ./StockManager.cs ./ThreadNotify.cs ./ToggleActionEntry.cs ./Timeout.cs ./TreeEnumerator.cs ./TreeNodeAttribute.cs ./TreeNode.cs ./TreeNodeValueAttribute.cs AssemblyInfo.cs Window.custom(149,34): error CS0234: The type or namespace name `MoveFocusHandler' does not exist in the namespace `Gtk'. Are you missing an assembly reference? AboutDialog.custom(23,31): warning CS0108: `Gtk.AboutDialog.Name' hides inherited member `Gtk.Widget.Name'. Use the new keyword if hiding was intended generated/Widget.cs(52,25): (Location of the symbol related to previous warning) TextView.custom(98,34): error CS0234: The type or namespace name `MoveFocusHandler' does not exist in the namespace `Gtk'. Are you missing an assembly reference? generated/TreePath.cs(11,22): warning CS0659: `Gtk.TreePath' overrides Object.Equals(object) but does not override Object.GetHashCode() Compilation failed: 2 error(s), 2 warnings make[3]: *** [gtk-sharp.dll] Error 1 make[3]: Leaving directory `/home/esqueleto/myTrash/MonoInstall/gtk-sharp/gtk' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/esqueleto/myTrash/MonoInstall/gtk-sharp/gtk' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/esqueleto/myTrash/MonoInstall/gtk-sharp' make: *** [all] Error 2 How can I compile this? To run the SVN version of MonoDevelop I'm getting error that someone told me on #MonoDevelop that was resolved in GTK-Sharp last version. How can I compile it? regards Paulo Aboim Pinto -- Have income spending 5 minutes a day Click here: http://bux.to/?r=esqueleto -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080123/4e01a96f/attachment.html From mkestner at gmail.com Wed Jan 23 19:00:39 2008 From: mkestner at gmail.com (Mike Kestner) Date: Wed, 23 Jan 2008 18:00:39 -0600 Subject: [Gtk-sharp-list] Compile the SVN version. Need help!! In-Reply-To: <10b6506f0801231222g37be99bao64889100ff913aff@mail.gmail.com> References: <10b6506f0801231222g37be99bao64889100ff913aff@mail.gmail.com> Message-ID: On Jan 23, 2008 2:22 PM, Paulo Aboim Pinto wrote: > > When I do ./configure --prefix=/usr I get this output: I'm assuming you meant ./bootstrap-2.12 --prefix=/usr. BTW, installing an svn version of any software into /usr is a tremendously bad idea. > How can I compile this? To run the SVN version of MonoDevelop I'm getting > error that someone told me on #MonoDevelop that was resolved in GTK-Sharp > last version. No idea what's going on there. I just checked out a clean svn trunk instance, ran bootstrap-2.12 and my make succeeded. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080123/de73b9ab/attachment.html From mkestner at novell.com Thu Jan 24 17:41:25 2008 From: mkestner at novell.com (Mike Kestner) Date: Thu, 24 Jan 2008 16:41:25 -0600 Subject: [Gtk-sharp-list] Announcing Preview Release for Gtk 2.12 and Gnome 2.20 bindings Message-ID: <1201214485.1444.304.camel@t61p.site> We are announcing the first public preview release of bindings for the Gtk 2.12 and Gnome 2.20 APIs. These releases are not API-stable yet, but are sufficiently mature to begin testing against. Anticipated API adjustments are expected to be minimal at this point but might occur until we reach the stable 2.12.0 and 2.20.0 versions. The gtk-sharp package contains bindings for glib, pango, atk, gdk, gtk, and glade. The API versions bound correspond to the versions shipped in the GNOME 2.20 platform release set. The gnome-sharp package binding set has changed with this release. Remaining in gnome-sharp are art, gnomevfs, libgnome, libgnomeui, libgnomeprint, libgnomeprintui, libpanelapplet, libgnomecanvas, and gconf bindings. The gnome-desktop-sharp package contains updated versions of the gtkhtml, rsvg and vte bindings previously shipped in gnome-sharp, as well as new bindings for libgnome-desktop, libnautilus-burn, and libwnck. We expect to add gtksourceview2 bindings as well prior to the final release. Bindings shipped in this package are not guaranteed to be API stable since the underlying libraries are not guaranteed API stable. Attempts will be made to maintain compatibility where possible, using policy assemblies. When API compatibility is broken in underlying libraries, the associated bindings will be parallel-installable with prior versions. Testing packages for openSUSE 10.3 and Fedora 8 can be found at: http://download.opensuse.org/repositories/home:/mkestner/ Source tarballs are available from ftp.gnome.org. We expect to move rapidly toward the 2.12 and 2.20 final release, with possibly one more preview depending on the number of issues identified. Issues can be reported to bugzilla.novell.com module gtk#. -- Mike Kestner From bes at schiessle.org Fri Jan 25 09:16:09 2008 From: bes at schiessle.org (Bjoern Schiessle) Date: Fri, 25 Jan 2008 15:16:09 +0100 Subject: [Gtk-sharp-list] Gtk.AboutDialog Message-ID: Hello, i wrote a small Gtk# program which works fine under Debian, Ubuntu and Windows. Now i have tried it with Fedora where the close-button of Gtk.AboutDialog doesn't work. Since the close-button works with Tomboy at Fedora i have looked into the source code of Tomboy and found the difference. Tomboy has a aboutDialog.Destroy() statement after the aboutDialog.Run() statement. If i add this statement to my code the close-button works on Fedora too. But i wonder what is the correct behaviour? The example here[1] doesn't uses the destroy() statement at the end. Intuitional i would say that the example is correct and that i don't need this statement. The behaviour of the close button should be implemented already in the close-button-handler of the Gtk.AboutDialog. So is it a bug in the Fedora package that i need this statement or is it a bug in the Debian, Ubuntu, Windows packages that it also works without this statement? [1] http://www.go-mono.com/docs/monodoc.ashx?tlink=5 at ecma%3a669%23AboutDialog%2f best wishes, Bjoern -- Join the Fellowship and protect your freedom! (http://fsfe.org/join) From mkestner at gmail.com Fri Jan 25 10:51:42 2008 From: mkestner at gmail.com (Mike Kestner) Date: Fri, 25 Jan 2008 09:51:42 -0600 Subject: [Gtk-sharp-list] Gtk.AboutDialog In-Reply-To: References: Message-ID: On Jan 25, 2008 8:16 AM, Bjoern Schiessle wrote: > > But i wonder what is the correct behaviour? The example here[1] doesn't > uses the destroy() statement at the end. Intuitional i would say that > the example is correct and that i don't need this statement. The > behaviour of the close button should be implemented already in the > close-button-handler of the Gtk.AboutDialog. The example doesn't have a Destroy call because the program ends immediately after the Run call. If you want the Dialog to go away on close, you should either hide or destroy it when the Run call is done. All Dialog subclasses require this type of cleanup. As far as why it works on fedora vs ubuntu, it's hard to provide any reasonable response without knowing more details, like code, Gtk# versions, Gtk+ versions, etc... The short answer is, the Destroy () call is correct. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080125/69a75eb2/attachment.html From jakub at indexdata.dk Fri Jan 25 11:47:03 2008 From: jakub at indexdata.dk (Jakub Skoczen) Date: Fri, 25 Jan 2008 17:47:03 +0100 Subject: [Gtk-sharp-list] App using gecko-sharp won't start. Message-ID: Hey Guys, I am using the MonoDevelop IDE to build a GTK# application that embeds Gecko. When run from within MD, the app starts up and works fine. However, when I try to run it from the command line it won't work. Running: mono gecko-experiments.exe ended with: System.TypeInitializationException: An exception was thrown by the type initializer for Gecko.WebControl ---> System.DllNotFoundException: /usr/lib/firefox/libgtkembedmoz.so so I've set the LD_LIBRARY_PATH=/usr/lib/firefox and I got what can be seen below. I tried enabling launch script generation in MD (0.14) but I cannot see it generating any scripts. I'm running Ubuntu 7.10. Any ideas on what's wrong with that? Stacktrace: at (wrapper managed-to-native) Gtk.Container.gtk_container_add (intptr,intptr) <0x00004> at (wrapper managed-to-native) Gtk.Container.gtk_container_add (intptr,intptr) <0xffffffff> at Gtk.Container.Add (Gtk.Widget) <0x00034> at geckoexperiments.MainWindow..ctor (Gecko.WebControl) <0x000b9> at geckoexperiments.MainClass.Main (string[]) <0x0005b> at (wrapper runtime-invoke) System.Object.runtime_invoke_void_string[] (object,intptr,intptr,intptr) <0xffffffff> Native stacktrace: mono [0x8194ca6] mono [0x81770ed] [0xffffe440] /usr/lib/firefox/libgtkembedmoz.so [0xb696d84b] /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x49) [0xb6b67c09] /usr/lib/libgobject-2.0.so.0 [0xb6b58f89] /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x122) [0xb6b5a772] /usr/lib/libgobject-2.0.so.0 [0xb6b6b7ba] /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x8c7) [0xb6b6c847] /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0xb6b6ca09] /usr/lib/libgtk-x11-2.0.so.0(gtk_widget_realize+0x8d) [0xb7000add] /usr/lib/libgtk-x11-2.0.so.0(gtk_widget_set_parent+0x1e2) [0xb70010f2] /usr/lib/libgtk-x11-2.0.so.0 [0xb6df8752] /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__OBJECT+0x59) [0xb6b67119] /usr/lib/libgobject-2.0.so.0 [0xb6b58f89] /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x122) [0xb6b5a772] /usr/lib/libgobject-2.0.so.0 [0xb6b6b7ba] /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x8c7) [0xb6b6c847] /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x29) [0xb6b6ca09] /usr/lib/libgtk-x11-2.0.so.0(gtk_container_add+0xf8) [0xb6e3e458] [0xb676659e] [0xb676653d] [0xb74aad9a] [0xb749ef14] [0xb749e7d5] mono [0x8176f50] mono(mono_runtime_invoke+0x27) [0x80b0b2f] mono(mono_runtime_exec_main+0x142) [0x80b5383] mono(mono_runtime_run_main+0x27e) [0x80b5631] mono(mono_jit_exec+0xbd) [0x805a4cb] mono [0x805a5a8] mono(mono_main+0x1683) [0x805bdc9] mono [0x8059636] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe0) [0xb7d83050] mono [0x80595b1] Debug info from gdb: (no debugging symbols found) Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1210665264 (LWP 3565)] [New Thread -1219900528 (LWP 3567)] [New Thread -1214145648 (LWP 3566)] (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) 0xffffe410 in __kernel_vsyscall () 3 Thread -1214145648 (LWP 3566) 0xffffe410 in __kernel_vsyscall () 2 Thread -1219900528 (LWP 3567) 0xffffe410 in __kernel_vsyscall () 1 Thread -1210665264 (LWP 3565) 0xffffe410 in __kernel_vsyscall () Thread 3 (Thread -1214145648 (LWP 3566)): #0 0xffffe410 in __kernel_vsyscall () #1 0xb7ee89f6 in ?? () from /lib/tls/i686/cmov/libpthread.so.0 #2 0x0811bc9f in ?? () #3 0xb7a193ac in ?? () #4 0x00000000 in ?? () Thread 2 (Thread -1219900528 (LWP 3567)): #0 0xffffe410 in __kernel_vsyscall () #1 0xb7ee5676 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/i686/cmov/libpthread.so.0 #2 0x08120dde in ?? () #3 0xb79861dc in ?? () #4 0xb79861c4 in ?? () #5 0xb7ee3541 in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0 #6 0x081210eb in ?? () #7 0xb79861dc in ?? () #8 0xb79861c4 in ?? () #9 0x00000000 in ?? () Thread 1 (Thread -1210665264 (LWP 3565)): #0 0xffffe410 in __kernel_vsyscall () #1 0xb7e392a1 in select () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7f58780 in g_spawn_sync () from /usr/lib/libglib-2.0.so.0 #3 0xb7f58b4c in g_spawn_command_line_sync () from /usr/lib/libglib-2.0.so.0 #4 0x08194d84 in ?? () #5 0xb7c26844 in ?? () #6 0xb7c2682c in ?? () #7 0xb7c26828 in ?? () #8 0xb7c26824 in ?? () #9 0x00000000 in ?? () #0 0xffffe410 in __kernel_vsyscall () ================================================================= Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= Aborted (core dumped) From spam at pvanhoof.be Sun Jan 27 18:35:18 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Mon, 28 Jan 2008 00:35:18 +0100 Subject: [Gtk-sharp-list] .NET bindings for Tinymail, skeleton added to repository but I still have some compilation problems Message-ID: <1201476918.8677.80.camel@schtrumpf> Hi there, I just added the skeleton for .NET bindings to Tinymail. Tinymail is a library intended for mobile E-mail clients. The idea behind the library is to give infrastructure, tools and types to build an E-mail client that'll run on a mobile device. It's core goals are low memory consumption, few round trips and low bandwidth requirements. An example is Nokia's Modest which is using Tinymail to create an E-mail client for the N800 and N810 devices. bla bla bla Its types are very often GTypeInterface ones. I learned from Mike's blog that newer Gapi versions have some support for this build in. Eager to test this stuff, I tried it and indeed I'm seeing the various Gapi tools find my interfaces and create .NET equivalents. This is the SVN commit for the skeleton, by the way: http://tinymail.org/trac/tinymail/changeset/3302 You enable it using --enable-dotnet-bindings cd bindings/dotnet ; make It wont compile yet, though. I got these errors: AssemblyInfo.cs generated/*.cs -o libtinymail-sharp.dll warning CS8029: Compatibility: Use -unsafe instead of --unsafe warning CS8029: Compatibility: Use -target:KIND instead of --target KIND warning CS8029: Compatibility: Use -out:FILE instead of --output FILE or -o FILE generated/Account.cs(75,33): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `PassFuncFunc' generated/Account.cs(73,33): (Location of the symbol related to previous error) generated/Account.cs(76,36): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `ForgetPassFuncFunc' generated/Account.cs(74,36): (Location of the symbol related to previous error) generated/Account.cs(77,22): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `PortFunc' generated/Account.cs(71,22): (Location of the symbol related to previous error) generated/Account.cs(78,24): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `UrlStringFunc' generated/Account.cs(72,24): (Location of the symbol related to previous error) generated/Account.cs(86,38): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `ConnectionPolicyFunc' generated/Account.cs(85,38): (Location of the symbol related to previous error) generated/Folder.cs(85,39): error CS0102: The type `Tny.FolderImplementor' already contains a definition for `MsgRemoveStrategyFunc' generated/Folder.cs(84,39): (Location of the symbol related to previous error) generated/Folder.cs(87,40): error CS0102: The type `Tny.FolderImplementor' already contains a definition for `MsgReceiveStrategyFunc' generated/Folder.cs(86,40): (Location of the symbol related to previous error) generated/MergeFolder.cs(150,39): error CS0102: The type `Tny.MergeFolder' already contains a definition for `FolderType' generated/MergeFolder.cs(71,39): (Location of the symbol related to previous error) generated/MimePartSaver.cs(21,42): error CS0102: The type `Tny.MimePartSaverImplementor' already contains a definition for `SaveStrategyFunc' generated/MimePartSaver.cs(20,42): (Location of the symbol related to previous error) generated/MimePartView.cs(21,30): error CS0102: The type `Tny.MimePartViewImplementor' already contains a definition for `PartFunc' generated/MimePartView.cs(20,30): (Location of the symbol related to previous error) generated/MsgView.cs(24,25): error CS0102: The type `Tny.MsgViewImplementor' already contains a definition for `MsgFunc' generated/MsgView.cs(23,25): (Location of the symbol related to previous error) Compilation failed: 11 error(s), 3 warnings make: *** [libtinymail-sharp.dll] Error 1 pvanhoof at schtrumpf:~/repos/tinymail/trunk/bindings/dotnet$ I wonder what my options are. Can I override sufficient things to get rid of these problems? Can I provide my own alternative code for the properties and methods that are failing here? And how? And if documented, where can I find this documentation? Another question: can I change the type hierarchy of generated types? I for example have a Tny.List and a Tny.Iterator that I sure would like to adapt to make it implement the IList interface of .NET. I also have a Tny.Stream that I think could use some System.IO.Stream magic here and there. I would prefer to have language bindings that are comparable to each other in API. I'm adding J?rg Billeter in CC. J?rg coded on the Vala bindings for Tinymail. Vala, the programming language, is being designed after C#. Therefore I'm confident that the bindings can be made to look the same. -- 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 Mon Jan 28 17:41:57 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Mon, 28 Jan 2008 23:41:57 +0100 Subject: [Gtk-sharp-list] .NET bindings for Tinymail, skeleton added to repository but I still have some compilation problems In-Reply-To: <1201476918.8677.80.camel@schtrumpf> References: <1201476918.8677.80.camel@schtrumpf> Message-ID: <1201560117.8637.3.camel@schtrumpf> I noticed the previous errors where created by the code generator not coping with _func appended vfunc names in the class's structs. I removed those from the API, now I get this list of errors (which looks more sane to me, but still, I wonder how to fix all this). warning CS8029: Compatibility: Use -out:FILE instead of --output FILE or -o FILE generated/ListAdapter.cs(22,39): error CS1041: Identifier expected: `foreach' is a keyword generated/ListAdapter.cs(14,24): error CS1527: Namespace elements cannot be explicitly declared as private, protected or protected internal generated/ListAdapter.cs(28,36): error CS1518: Expected `class', `delegate', `enum', `interface', or `struct' generated/ListAdapter.cs(43,29): error CS0116: A namespace can only contain types and namespace declarations generated/ListAdapter.cs(59,29): error CS0116: A namespace can only contain types and namespace declarations generated/ListAdapter.cs(72,29): error CS0116: A namespace can only contain types and namespace declarations generated/ListAdapter.cs(85,29): error CS0116: A namespace can only contain types and namespace declarations generated/ListAdapter.cs(98,31): error CS0116: A namespace can only contain types and namespace declarations generated/ListAdapter.cs(114,31): error CS0116: A namespace can only contain types and namespace declarations generated/ListAdapter.cs(130,29): error CS0116: A namespace can only contain types and namespace declarations generated/ListAdapter.cs(147,38): error CS1002: Expecting `;' generated/ListAdapter.cs(140,29): error CS0116: A namespace can only contain types and namespace declarations generated/LockableAdapter.cs(18,45): error CS1041: Identifier expected: `lock' is a keyword generated/LockableAdapter.cs(14,24): error CS1527: Namespace elements cannot be explicitly declared as private, protected or protected internal generated/LockableAdapter.cs(22,40): error CS1518: Expected `class', `delegate', `enum', `interface', or `struct' generated/LockableAdapter.cs(32,29): error CS0116: A namespace can only contain types and namespace declarations generated/LockableAdapter.cs(45,29): error CS0116: A namespace can only contain types and namespace declarations generated/LockableAdapter.cs(57,38): error CS1002: Expecting `;' generated/LockableAdapter.cs(54,29): error CS0116: A namespace can only contain types and namespace declarations generated/MergeFolder.cs(150,39): error CS0102: The type `Tny.MergeFolder' already contains a definition for `FolderType' generated/MergeFolder.cs(71,39): (Location of the symbol related to previous error) Compilation failed: 20 error(s), 3 warnings make[3]: *** [libtinymail-sharp.dll] Error 1 make[3]: Leaving directory `/home/pvanhoof/repos/tinymail/trunk/bindings/dotnet' On Mon, 2008-01-28 at 00:35 +0100, Philip Van Hoof wrote: > Hi there, > > I just added the skeleton for .NET bindings to Tinymail. > > Tinymail is a library intended for mobile E-mail clients. > > The idea behind the library is to give infrastructure, tools and types > to build an E-mail client that'll run on a mobile device. It's core > goals are low memory consumption, few round trips and low bandwidth > requirements. > > An example is Nokia's Modest which is using Tinymail to create an > E-mail client for the N800 and N810 devices. > > bla bla bla > > Its types are very often GTypeInterface ones. I learned from Mike's blog > that newer Gapi versions have some support for this build in. > > Eager to test this stuff, I tried it and indeed I'm seeing the various > Gapi tools find my interfaces and create .NET equivalents. > > This is the SVN commit for the skeleton, by the way: > http://tinymail.org/trac/tinymail/changeset/3302 > You enable it using --enable-dotnet-bindings > > cd bindings/dotnet ; make > > It wont compile yet, though. I got these errors: > > AssemblyInfo.cs generated/*.cs -o libtinymail-sharp.dll > warning CS8029: Compatibility: Use -unsafe instead of --unsafe > warning CS8029: Compatibility: Use -target:KIND instead of --target KIND > warning CS8029: Compatibility: Use -out:FILE instead of --output FILE or -o FILE > generated/Account.cs(75,33): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `PassFuncFunc' > generated/Account.cs(73,33): (Location of the symbol related to previous error) > generated/Account.cs(76,36): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `ForgetPassFuncFunc' > generated/Account.cs(74,36): (Location of the symbol related to previous error) > generated/Account.cs(77,22): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `PortFunc' > generated/Account.cs(71,22): (Location of the symbol related to previous error) > generated/Account.cs(78,24): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `UrlStringFunc' > generated/Account.cs(72,24): (Location of the symbol related to previous error) > generated/Account.cs(86,38): error CS0102: The type `Tny.AccountImplementor' already contains a definition for `ConnectionPolicyFunc' > generated/Account.cs(85,38): (Location of the symbol related to previous error) > generated/Folder.cs(85,39): error CS0102: The type `Tny.FolderImplementor' already contains a definition for `MsgRemoveStrategyFunc' > generated/Folder.cs(84,39): (Location of the symbol related to previous error) > generated/Folder.cs(87,40): error CS0102: The type `Tny.FolderImplementor' already contains a definition for `MsgReceiveStrategyFunc' > generated/Folder.cs(86,40): (Location of the symbol related to previous error) > generated/MergeFolder.cs(150,39): error CS0102: The type `Tny.MergeFolder' already contains a definition for `FolderType' > generated/MergeFolder.cs(71,39): (Location of the symbol related to previous error) > generated/MimePartSaver.cs(21,42): error CS0102: The type `Tny.MimePartSaverImplementor' already contains a definition for `SaveStrategyFunc' > generated/MimePartSaver.cs(20,42): (Location of the symbol related to previous error) > generated/MimePartView.cs(21,30): error CS0102: The type `Tny.MimePartViewImplementor' already contains a definition for `PartFunc' > generated/MimePartView.cs(20,30): (Location of the symbol related to previous error) > generated/MsgView.cs(24,25): error CS0102: The type `Tny.MsgViewImplementor' already contains a definition for `MsgFunc' > generated/MsgView.cs(23,25): (Location of the symbol related to previous error) > Compilation failed: 11 error(s), 3 warnings > make: *** [libtinymail-sharp.dll] Error 1 > pvanhoof at schtrumpf:~/repos/tinymail/trunk/bindings/dotnet$ > > > I wonder what my options are. Can I override sufficient things to get > rid of these problems? Can I provide my own alternative code for the > properties and methods that are failing here? > > And how? And if documented, where can I find this documentation? > > Another question: can I change the type hierarchy of generated types? I > for example have a Tny.List and a Tny.Iterator that I sure would like to > adapt to make it implement the IList interface of .NET. I also have a > Tny.Stream that I think could use some System.IO.Stream magic here and > there. > > I would prefer to have language bindings that are comparable to each > other in API. I'm adding J?rg Billeter in CC. J?rg coded on the Vala > bindings for Tinymail. Vala, the programming language, is being designed > after C#. Therefore I'm confident that the bindings can be made to look > the same. > > > -- 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 novell.com Mon Jan 28 17:50:04 2008 From: mkestner at novell.com (Mike Kestner) Date: Mon, 28 Jan 2008 16:50:04 -0600 Subject: [Gtk-sharp-list] Announcing the 2nd Preview Release for Gtk 2.12 and Gnome 2.20 bindings Message-ID: <1201560604.1444.337.camel@t61p.site> We are announcing the second public preview release of bindings for the Gnome 2.20 APIs. This release includes gnome-sharp-2.19.91 and gnome-desktop-sharp-2.19.1 to fix configuration and API stability issues identified in the initial release. The gtk-sharp package remains at version 2.11.91 released last week. Tarballs are available from ftp.gnome.org, and packages for Fedora8 and OpenSUSE 10.3 are available at: http://download.opensuse.org/repositories/home:/mkestner/ These releases are not API-stable yet, but are sufficiently mature to begin testing against. Anticipated API adjustments are expected to be minimal at this point but might occur until we reach the stable 2.12.0 and 2.20.0 versions. The gtk-sharp package contains bindings for glib, pango, atk, gdk, gtk, and glade. The API versions bound correspond to the versions shipped in the GNOME 2.20 platform release set. The gnome-sharp package binding set has changed with this release. Remaining in gnome-sharp are art, gnomevfs, libgnome, libgnomeui, libgnomeprint, libgnomeprintui, libpanelapplet, libgnomecanvas, and gconf bindings. The gnome-desktop-sharp package contains updated versions of the gtkhtml, rsvg and vte bindings previously shipped in gnome-sharp, as well as new bindings for libgnome-desktop, libnautilus-burn, and libwnck. We expect to add gtksourceview2 bindings as well prior to the final release. Bindings shipped in this package are not guaranteed to be API stable since the underlying libraries are not guaranteed API stable. Attempts will be made to maintain compatibility where possible, using policy assemblies. When API compatibility is broken in underlying libraries, the associated bindings will be parallel-installable with prior versions. Testing packages for openSUSE 10.3 and Fedora 8 can be found at: http://download.opensuse.org/repositories/home:/mkestner/ Source tarballs are available from ftp.gnome.org. We expect to move rapidly toward the 2.12 and 2.20 final release, with possibly one more preview depending on the number of issues identified. Issues can be reported to bugzilla.novell.com module gtk#. -- Mike Kestner From mkestner at gmail.com Mon Jan 28 17:51:37 2008 From: mkestner at gmail.com (Mike Kestner) Date: Mon, 28 Jan 2008 16:51:37 -0600 Subject: [Gtk-sharp-list] .NET bindings for Tinymail, skeleton added to repository but I still have some compilation problems In-Reply-To: <1201560117.8637.3.camel@schtrumpf> References: <1201476918.8677.80.camel@schtrumpf> <1201560117.8637.3.camel@schtrumpf> Message-ID: On Jan 28, 2008 4:41 PM, Philip Van Hoof wrote: > I noticed the previous errors where created by the code generator not > coping with _func appended vfunc names in the class's structs. Could you file a bug report for that please? > I removed those from the API, now I get this list of errors (which looks > more sane to me, but still, I wonder how to fix all this). > > > warning CS8029: Compatibility: Use -out:FILE instead of --output FILE or > -o FILE > generated/ListAdapter.cs(22,39): error CS1041: Identifier expected: > `foreach' is a keyword > generated/ListAdapter.cs(14,24): error CS1527: Namespace elements cannot > be explicitly declared as private, protected or protected internal > generated/ListAdapter.cs(28,36): error CS1518: Expected `class', > `delegate', `enum', `interface', or `struct' > generated/ListAdapter.cs(43,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/ListAdapter.cs(59,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/ListAdapter.cs(72,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/ListAdapter.cs(85,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/ListAdapter.cs(98,31): error CS0116: A namespace can only > contain types and namespace declarations > generated/ListAdapter.cs(114,31): error CS0116: A namespace can only > contain types and namespace declarations > generated/ListAdapter.cs(130,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/ListAdapter.cs(147,38): error CS1002: Expecting `;' > generated/ListAdapter.cs(140,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/LockableAdapter.cs(18,45): error CS1041: Identifier expected: > `lock' is a keyword > generated/LockableAdapter.cs(14,24): error CS1527: Namespace elements > cannot be explicitly declared as private, protected or protected internal > generated/LockableAdapter.cs(22,40): error CS1518: Expected `class', > `delegate', `enum', `interface', or `struct' > generated/LockableAdapter.cs(32,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/LockableAdapter.cs(45,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/LockableAdapter.cs(57,38): error CS1002: Expecting `;' > generated/LockableAdapter.cs(54,29): error CS0116: A namespace can only > contain types and namespace declarations > generated/MergeFolder.cs(150,39): error CS0102: The type `Tny.MergeFolder' > already contains a definition for `FolderType' > generated/MergeFolder.cs(71,39): (Location of the symbol related to > previous error) > Compilation failed: 20 error(s), 3 warnings > make[3]: *** [libtinymail-sharp.dll] Error 1 > make[3]: Leaving directory > `/home/pvanhoof/repos/tinymail/trunk/bindings/dotnet' > I'll take a look at this tomorrow. Thanks for trying it out. Those both look like simple keyword mangling issues. They just need to be added to the SymbolTable method that does the mangling. You could file a bug for those as well if you wanted. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080128/a47bdf25/attachment.html From spam at pvanhoof.be Mon Jan 28 17:59:24 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Mon, 28 Jan 2008 23:59:24 +0100 Subject: [Gtk-sharp-list] .NET bindings for Tinymail, skeleton added to repository but I still have some compilation problems In-Reply-To: References: <1201476918.8677.80.camel@schtrumpf> <1201560117.8637.3.camel@schtrumpf> Message-ID: <1201561164.8637.10.camel@schtrumpf> On Mon, 2008-01-28 at 16:51 -0600, Mike Kestner wrote: > On Jan 28, 2008 4:41 PM, Philip Van Hoof wrote: > I noticed the previous errors where created by the code generator not > coping with _func appended vfunc names in the class's structs. > > Could you file a bug report for that please? Will do. > I removed those from the API, now I get this list of errors (which > looks more sane to me, but still, I wonder how to fix all this). > > > warning CS8029: Compatibility: Use -out:FILE instead of > --output FILE or -o FILE > > generated/ListAdapter.cs(22,39): error CS1041: Identifier > expected: `foreach' is a keyword ps. I'm trying things like this without success. Studying that fixup code :) > I'll take a look at this tomorrow. Thanks for trying it out. Those > both look like simple keyword mangling issues. They just need to be > added to the SymbolTable method that does the mangling. You could > file a bug for those as well if you wanted. Okay, will do. Some of the compilation errors are about actual words being used that generate to a C# construction that uses a C# keyword. Might be hard to fix. Lucky I don't really need them, although having access the the C developer's fast foreach implementation of the list could become useful when implementing a IList with a IEnumeratable, etc. I'm guessing that if I want to add an 'implements', I do something like this to the metadata file: And then make a List.custom that implements all that IList needs (which can be done with tny's list API). Right? (it's a guess) -- 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 Mon Jan 28 18:18:22 2008 From: mkestner at gmail.com (Mike Kestner) Date: Mon, 28 Jan 2008 17:18:22 -0600 Subject: [Gtk-sharp-list] .NET bindings for Tinymail, skeleton added to repository but I still have some compilation problems In-Reply-To: <1201561164.8637.10.camel@schtrumpf> References: <1201476918.8677.80.camel@schtrumpf> <1201560117.8637.3.camel@schtrumpf> <1201561164.8637.10.camel@schtrumpf> Message-ID: On Jan 28, 2008 4:59 PM, Philip Van Hoof wrote: > > > ps. I'm trying things like this without success. Studying that fixup > code :) > > > > > path="/api/namespace/object[@cname='TnyList']/method[@cname='foreach']" /> > That method cname would probably be something like tny_list_foreach, or you could do @name='Foreach'. The error is most likely due to a parameter named foreach, though, I'm guessing, which could be renamed to foreach_cb or something like that to get around the current lack of generator mangling. > I'm guessing that if I want to add an 'implements', I do something like > this to the metadata file: > > path="/api/namespace/object[@cname='TnyList']/implements/interface[@name='IList']" > /> > And then make a List.custom that implements all that IList needs (which > can be done with tny's list API). Yep. You can take a look at Gtk.ListStore. It has an IEnumerable implementation. I hacked up that metadata rule above from its rule. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080128/4a3eae70/attachment.html From spam at pvanhoof.be Wed Jan 30 04:20:42 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Wed, 30 Jan 2008 10:20:42 +0100 Subject: [Gtk-sharp-list] I can make it crash! Message-ID: <1201684842.8544.0.camel@schtrumpf> This looks like a bug in the code generator ;) /opt/gtk-sharp/bin//gapi2-codegen --generate libtinymail-camel-api.xml \ \ --outdir=generated --customdir=. --assembly-name=libtinymail-camel-sharp \ && touch generated-stamp Name: auth_types Type: TnyList* in callback TnyCamelGetSupportedSecureAuthCallback Tny.Camel.TnyCamelAccount implements unknown GInterface TnyAccount Tny.Camel.TnyCamelBsMimePart implements unknown GInterface TnyMimePart Tny.Camel.TnyCamelBsMsg implements unknown GInterface TnyMsg Tny.Camel.TnyCamelBsMsgReceiveStrategy implements unknown GInterface TnyMsgReceiveStrategy Tny.Camel.TnyCamelDefaultConnectionPolicy implements unknown GInterface TnyConnectionPolicy Tny.Camel.TnyCamelFolder implements unknown GInterface TnyFolderStore Tny.Camel.TnyCamelFullMsgReceiveStrategy implements unknown GInterface TnyMsgReceiveStrategy Tny.Camel.TnyCamelMimePart implements unknown GInterface TnyMimePart Tny.Camel.TnyCamelMsg implements unknown GInterface TnyMsg Tny.Camel.TnyCamelMsgRemoveStrategy implements unknown GInterface TnyMsgRemoveStrategy Tny.Camel.TnyCamelPartialMsgReceiveStrategy implements unknown GInterface TnyMsgReceiveStrategy Tny.Camel.TnyCamelPopRemoteMsgRemoveStrategy implements unknown GInterface TnyMsgRemoveStrategy Tny.Camel.TnyCamelRecoverConnectionPolicy implements unknown GInterface TnyConnectionPolicy Tny.Camel.TnyCamelSendQueue implements unknown GInterface TnyFolderObserver Tny.Camel.TnyCamelStoreAccount implements unknown GInterface TnyFolderStore Tny.Camel.TnyCamelStream implements unknown GInterface TnyStream Tny.Camel.TnyCamelTransportAccount implements unknown GInterface TnyTransportAccount Name: account_store Type: TnyAccountStore* in tny_session_camel_new in type Tny.Camel.TnySessionCamel Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required. at GtkSharp.Generation.ClassBase.GetMethodRecursively (System.String name, Boolean check_self) [0x00000] at GtkSharp.Generation.ClassBase.GetMethodRecursively (System.String name, Boolean check_self) [0x00000] at GtkSharp.Generation.ClassBase.GetMethodRecursively (System.String name) [0x00000] at GtkSharp.Generation.Method.GenerateDeclCommon (System.IO.StreamWriter sw, GtkSharp.Generation.ClassBase implementor) [0x00000] at GtkSharp.Generation.Method.Generate (GtkSharp.Generation.GenerationInfo gen_info, GtkSharp.Generation.ClassBase implementor) [0x00000] at GtkSharp.Generation.ClassBase.GenMethods (GtkSharp.Generation.GenerationInfo gen_info, System.Collections.Hashtable collisions, GtkSharp.Generation.ClassBase implementor) [0x00000] at GtkSharp.Generation.ObjectGen.Generate (GtkSharp.Generation.GenerationInfo gen_info) [0x00000] at GtkSharp.Generation.CodeGenerator.Main (System.String[] args) [0x00000] make[2]: *** [generated-stamp] Error 1 make[2]: Leaving directory `/home/pvanhoof/repos/tinymail/trunk/bindings/dotnet/camel' -- 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 Wed Jan 30 04:55:56 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Wed, 30 Jan 2008 10:55:56 +0100 Subject: [Gtk-sharp-list] Tinymail DotNet bindings update Message-ID: <1201686956.8544.15.camel@schtrumpf> Hi there, I just committed the DotNet bindings for Tinymail. People who've been watching Tinymail's trunk might have noticed that I this this yesterday and the day before already. Today I completely restructured it, though. I made it more or less the same as how gtk-sharp itself is structured. This means that each separate library has its own subdirectory and the Makefile.am includes a toplevel Makefile.include. I even copied that Makefile.include from gtk-sharp's toplevel directory and adapted it (once Gapi is installed, it's not necessary to put the runtime's executable in front of it, and I had to adjust a few minor other things too) You can find the bindings here: https://svn.tinymail.org/svn/tinymail/trunk/bindings/dotnet/ They might not be 100% correct. I tried hard to get everything right immediately but I'm guessing it's not right yet. For example the libtinymail-platform-sharp for some reason only has one .cs file in generated. That can't be right. Most of the types that in the C API only have a constructor also didn't get a .cs file in the generated directory. If I look at the generated API, a lot is missing. I have no clue why the codegenerator of gapi is not generating code for those types. They do seem to be in the -api.xml and .raw files and they are not slashed in the .metadata files. The libtinymail-camel-sharp things seem to crash gapi's code generator, so this one is not in the SUBDIRS of bindings/dotnet/Makefile.am a.t.m. I'm generating .pc files for the pkgconfig libdir, but they might not be completely correct. I tried mimicking gtk-sharp's files but I might have gotten something wrong. I don't know (haven't testing it yet). The SNK file, the AssemblyInfo.cs file, are all things that I might have gotten wrong too. I tried copying as much as possible from how gtk-sharp does all this magic. I have not yet made .custom files for Tny.List and Tny.Stream. The reason is that both are GTypeInterface types (interfaces in .NET) and that adding code in the .custom file only alters the interface. It wont alter the Adaptor that Gapi generates. So I can't really influence these interfaces a lot (I can't make them require implementing IList, for example). For Tny.Stream I might have to rename the original Tny.Stream to something else in the .NET binding and make the .NET version of Tny.Stream inherit from System.IO.Stream. This, is going to be quite tricky to get it right, I think. I can really use assistance from the gurus in this channel. Tinymail is a relatively large library (in terms of API availability) with more compilation options, possibilities, combinations and switches than Gtk+ has. That's because the project's focus is mobiles and each and every mobile is typically different from each other mobile. Anyway .. so here's the skeleton of the binding. All the unpleasant crappy autotools work is done. The tweaking of it is something I'm sure a .NET enthusiast is going to like working on. https://svn.tinymail.org/svn/tinymail/trunk/bindings/dotnet/ -- 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 Wed Jan 30 05:05:05 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Wed, 30 Jan 2008 11:05:05 +0100 Subject: [Gtk-sharp-list] I can make it crash! In-Reply-To: <1201684842.8544.0.camel@schtrumpf> References: <1201684842.8544.0.camel@schtrumpf> Message-ID: <1201687505.8544.20.camel@schtrumpf> By adapting the INCLUDE_API to contain the -api.xml files of libraries where this one depends on, the crash no longer happens. So this seems to be related to the dependencies (I noticed this as I was reading the "implements unknown GInterface TnyBlaBla") On Wed, 2008-01-30 at 10:20 +0100, Philip Van Hoof wrote: > This looks like a bug in the code generator ;) > > > /opt/gtk-sharp/bin//gapi2-codegen --generate libtinymail-camel-api.xml \ > \ > --outdir=generated --customdir=. --assembly-name=libtinymail-camel-sharp \ > && touch generated-stamp > Name: auth_types Type: TnyList* in callback TnyCamelGetSupportedSecureAuthCallback > Tny.Camel.TnyCamelAccount implements unknown GInterface TnyAccount > Tny.Camel.TnyCamelBsMimePart implements unknown GInterface TnyMimePart > Tny.Camel.TnyCamelBsMsg implements unknown GInterface TnyMsg > Tny.Camel.TnyCamelBsMsgReceiveStrategy implements unknown GInterface TnyMsgReceiveStrategy > Tny.Camel.TnyCamelDefaultConnectionPolicy implements unknown GInterface TnyConnectionPolicy > Tny.Camel.TnyCamelFolder implements unknown GInterface TnyFolderStore > Tny.Camel.TnyCamelFullMsgReceiveStrategy implements unknown GInterface TnyMsgReceiveStrategy > Tny.Camel.TnyCamelMimePart implements unknown GInterface TnyMimePart > Tny.Camel.TnyCamelMsg implements unknown GInterface TnyMsg > Tny.Camel.TnyCamelMsgRemoveStrategy implements unknown GInterface TnyMsgRemoveStrategy > Tny.Camel.TnyCamelPartialMsgReceiveStrategy implements unknown GInterface TnyMsgReceiveStrategy > Tny.Camel.TnyCamelPopRemoteMsgRemoveStrategy implements unknown GInterface TnyMsgRemoveStrategy > Tny.Camel.TnyCamelRecoverConnectionPolicy implements unknown GInterface TnyConnectionPolicy > Tny.Camel.TnyCamelSendQueue implements unknown GInterface TnyFolderObserver > Tny.Camel.TnyCamelStoreAccount implements unknown GInterface TnyFolderStore > Tny.Camel.TnyCamelStream implements unknown GInterface TnyStream > Tny.Camel.TnyCamelTransportAccount implements unknown GInterface TnyTransportAccount > Name: account_store Type: TnyAccountStore* in tny_session_camel_new in type Tny.Camel.TnySessionCamel > > Unhandled Exception: System.NullReferenceException: A null value was found where an object instance was required. > at GtkSharp.Generation.ClassBase.GetMethodRecursively (System.String name, Boolean check_self) [0x00000] > at GtkSharp.Generation.ClassBase.GetMethodRecursively (System.String name, Boolean check_self) [0x00000] > at GtkSharp.Generation.ClassBase.GetMethodRecursively (System.String name) [0x00000] > at GtkSharp.Generation.Method.GenerateDeclCommon (System.IO.StreamWriter sw, GtkSharp.Generation.ClassBase implementor) [0x00000] > at GtkSharp.Generation.Method.Generate (GtkSharp.Generation.GenerationInfo gen_info, GtkSharp.Generation.ClassBase implementor) [0x00000] > at GtkSharp.Generation.ClassBase.GenMethods (GtkSharp.Generation.GenerationInfo gen_info, System.Collections.Hashtable collisions, GtkSharp.Generation.ClassBase implementor) [0x00000] > at GtkSharp.Generation.ObjectGen.Generate (GtkSharp.Generation.GenerationInfo gen_info) [0x00000] > at GtkSharp.Generation.CodeGenerator.Main (System.String[] args) [0x00000] > make[2]: *** [generated-stamp] Error 1 > make[2]: Leaving directory `/home/pvanhoof/repos/tinymail/trunk/bindings/dotnet/camel' -- 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 Wed Jan 30 05:08:27 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Wed, 30 Jan 2008 11:08:27 +0100 Subject: [Gtk-sharp-list] Tinymail DotNet bindings update In-Reply-To: <1201686956.8544.15.camel@schtrumpf> References: <1201686956.8544.15.camel@schtrumpf> Message-ID: <1201687707.8544.24.camel@schtrumpf> On Wed, 2008-01-30 at 10:55 +0100, Philip Van Hoof wrote: > For example the libtinymail-platform-sharp for some reason only has > one .cs file in generated. That can't be right. Most of the types that > in the C API only have a constructor also didn't get a .cs file in the > generated directory. If I look at the generated API, a lot is missing. > > I have no clue why the codegenerator of gapi is not generating code for > those types. They do seem to be in the -api.xml and .raw files and they > are not slashed in the .metadata files. By adjusting the INCLUDE_API to contain the -api.xml files of depending libraries (in this case the libraries libtinymailui, libtinymailui-gtk and libtinymail-camel) this seems to have improved. *learn learning learn* I'm not sure if I'm still missing types but it looks like the ones that I expect are now indeed being generated. Also check the crash that I mentioned in that other post on gtksharp's mailing list. This was related too. > https://svn.tinymail.org/svn/tinymail/trunk/bindings/dotnet/ -- 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 Wed Jan 30 05:47:06 2008 From: spam at pvanhoof.be (Philip Van Hoof) Date: Wed, 30 Jan 2008 11:47:06 +0100 Subject: [Gtk-sharp-list] Tinymail DotNet bindings update In-Reply-To: <1201686956.8544.15.camel@schtrumpf> References: <1201686956.8544.15.camel@schtrumpf> Message-ID: <1201690026.8544.29.camel@schtrumpf> Hi there, If I look at the prefix of both gtk-sharp and tinymail's -sharp installation, I noticed that gtk-sharp has .config files installed. Tinymail's -sharp install directory doesn't have these .config files installed. I'm not really immediately finding what in the build of gtk-sharp is installing them (I kept the Makefile.include identical for that part of the build Makefile code afaik). I'm guessing these config files are necessary for the .dll->.so mapping? Something like that is what they seem to contain as XML data. Obviously I mimicked them as good as possible using gtk-sharp's code. Also, what is this policy.$(API_VERSION).config file for by the way? On Wed, 2008-01-30 at 10:55 +0100, Philip Van Hoof wrote: > Hi there, > > I just committed the DotNet bindings for Tinymail. People who've been > watching Tinymail's trunk might have noticed that I this this yesterday > and the day before already. > > Today I completely restructured it, though. I made it more or less the > same as how gtk-sharp itself is structured. This means that each > separate library has its own subdirectory and the Makefile.am includes a > toplevel Makefile.include. > > I even copied that Makefile.include from gtk-sharp's toplevel directory > and adapted it (once Gapi is installed, it's not necessary to put the > runtime's executable in front of it, and I had to adjust a few minor > other things too) > > You can find the bindings here: > > https://svn.tinymail.org/svn/tinymail/trunk/bindings/dotnet/ > > > They might not be 100% correct. I tried hard to get everything right > immediately but I'm guessing it's not right yet. > > For example the libtinymail-platform-sharp for some reason only has > one .cs file in generated. That can't be right. Most of the types that > in the C API only have a constructor also didn't get a .cs file in the > generated directory. If I look at the generated API, a lot is missing. > > I have no clue why the codegenerator of gapi is not generating code for > those types. They do seem to be in the -api.xml and .raw files and they > are not slashed in the .metadata files. > > The libtinymail-camel-sharp things seem to crash gapi's code generator, > so this one is not in the SUBDIRS of bindings/dotnet/Makefile.am a.t.m. > > I'm generating .pc files for the pkgconfig libdir, but they might not be > completely correct. I tried mimicking gtk-sharp's files but I might have > gotten something wrong. I don't know (haven't testing it yet). > > The SNK file, the AssemblyInfo.cs file, are all things that I might have > gotten wrong too. I tried copying as much as possible from how gtk-sharp > does all this magic. > > I have not yet made .custom files for Tny.List and Tny.Stream. The > reason is that both are GTypeInterface types (interfaces in .NET) and > that adding code in the .custom file only alters the interface. It wont > alter the Adaptor that Gapi generates. So I can't really influence these > interfaces a lot (I can't make them require implementing IList, for > example). > > For Tny.Stream I might have to rename the original Tny.Stream to > something else in the .NET binding and make the .NET version of > Tny.Stream inherit from System.IO.Stream. This, is going to be quite > tricky to get it right, I think. > > I can really use assistance from the gurus in this channel. Tinymail is > a relatively large library (in terms of API availability) with more > compilation options, possibilities, combinations and switches than Gtk+ > has. That's because the project's focus is mobiles and each and every > mobile is typically different from each other mobile. > > > Anyway .. so here's the skeleton of the binding. All the unpleasant > crappy autotools work is done. > > The tweaking of it is something I'm sure a .NET enthusiast is going to > like working on. > > https://svn.tinymail.org/svn/tinymail/trunk/bindings/dotnet/ > > -- 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 Wed Jan 30 11:14:37 2008 From: mkestner at gmail.com (Mike Kestner) Date: Wed, 30 Jan 2008 10:14:37 -0600 Subject: [Gtk-sharp-list] I can make it crash! In-Reply-To: <1201687505.8544.20.camel@schtrumpf> References: <1201684842.8544.0.camel@schtrumpf> <1201687505.8544.20.camel@schtrumpf> Message-ID: On Jan 30, 2008 4:05 AM, Philip Van Hoof wrote: > > > Unhandled Exception: System.NullReferenceException: A null value was > found where an object instance was required. > > at GtkSharp.Generation.ClassBase.GetMethodRecursively (System.Stringname, Boolean check_self) [0x00000]-- > Thanks. I added some null checks for this in the ClassBase recursive lookup methods on revision 94388. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080130/fa230676/attachment.html From mkestner at gmail.com Wed Jan 30 11:56:47 2008 From: mkestner at gmail.com (Mike Kestner) Date: Wed, 30 Jan 2008 10:56:47 -0600 Subject: [Gtk-sharp-list] Tinymail DotNet bindings update In-Reply-To: <1201690026.8544.29.camel@schtrumpf> References: <1201686956.8544.15.camel@schtrumpf> <1201690026.8544.29.camel@schtrumpf> Message-ID: On Jan 30, 2008 4:47 AM, Philip Van Hoof wrote: > Tinymail's -sharp install directory doesn't have these .config files > installed. I'm not really immediately finding what in the build of > gtk-sharp is installing them (I kept the Makefile.include identical for > that part of the build Makefile code afaik). > > I'm guessing these config files are necessary for the .dll->.so mapping? > Something like that is what they seem to contain as XML data. Obviously > I mimicked them as good as possible using gtk-sharp's code. gacutil installs .dll.config files if they are present. They support different dll/so/dylib naming conventions across various platforms. The convention is to use win32 dll naming in the DllImport statements in the generated code, so that assemblies work on the MS runtime on win32. We use dllmap entries in the .config file so that mono can map them to the appropriate nomenclature on *nix and mac. > Also, what is this policy.$(API_VERSION).config file for by the way? > Policy assemblies are the backward compatibility mechanism on .Net. A program built against assembly version 2.4.0.0 requires that specific assembly version be available at runtime. One way to satisfy that requirement is to install a policy.2.4 assembly which "links" to a newer assembly version that provides all of the API exposed by 2.4.0.0. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080130/2ed9aac1/attachment.html From m.j.hutchinson at gmail.com Wed Jan 30 21:57:29 2008 From: m.j.hutchinson at gmail.com (Michael Hutchinson) Date: Wed, 30 Jan 2008 21:57:29 -0500 Subject: [Gtk-sharp-list] [Mono-dev] App using gecko-sharp won't start. In-Reply-To: References: Message-ID: On Jan 25, 2008 11:47 AM, Jakub Skoczen wrote: > Hey Guys, > > I am using the MonoDevelop IDE to build a GTK# application that embeds > Gecko. When run from within MD, the app starts up and works fine. > However, when I try to run it from the command line it won't work. > > Running: > > mono gecko-experiments.exe > > ended with: > > System.TypeInitializationException: An exception was thrown by the > type initializer for Gecko.WebControl ---> > System.DllNotFoundException: /usr/lib/firefox/libgtkembedmoz.so This is weird. Ubuntu/Debian does strange stuff here; the dllmap should only map dll names, not full paths. > so I've set the LD_LIBRARY_PATH=/usr/lib/firefox and I got what can be > seen below. I tried enabling launch script generation in MD (0.14) but > I cannot see it generating any scripts. I'm running Ubuntu 7.10. Any > ideas on what's wrong with that? > > Stacktrace: > > at (wrapper managed-to-native) Gtk.Container.gtk_container_add > (intptr,intptr) <0x00004> > at (wrapper managed-to-native) Gtk.Container.gtk_container_add > (intptr,intptr) <0xffffffff> > at Gtk.Container.Add (Gtk.Widget) <0x00034> > at geckoexperiments.MainWindow..ctor (Gecko.WebControl) <0x000b9> > at geckoexperiments.MainClass.Main (string[]) <0x0005b> > at (wrapper runtime-invoke) > System.Object.runtime_invoke_void_string[] > (object,intptr,intptr,intptr) <0xffffffff> > I'm not certain, but I think that GtkMozEmbed may require you to set MOZILLA_FIVE_HOME to your Firefox directory too. MonoDevelop certainly does this, which would propagate to child apps (e.g. when you run your app from within MD). -- Michael Hutchinson http://mjhutchinson.com From sdimitrovski at gmail.com Thu Jan 31 13:40:03 2008 From: sdimitrovski at gmail.com (Stojan Dimitrovski) Date: Thu, 31 Jan 2008 19:40:03 +0100 Subject: [Gtk-sharp-list] Alpha channel to widget Message-ID: <1201804803.4405.0.camel@act1v8> Hello, I've been struggling with this for a week now, it is time to ask. I need to create a Window, with a couple of widgets inside, one of which is an EventBox (or any other paintable parent widget). That parent window, the EventBox, contains it's child widgets, such as a Table and some custom widgets. Now, what I need is to give the EventBox and the table some transparency, with color of course something like, in RGBA: 1, 0, 0, 0.5... what we now would refer to Composited backround, but the custom widgets to stay intact, that is they should not catch on the alpha of the transparency. They should stay the way they are. Over the last week I tried everything I can think of. And it always proved wrong... either I saw no change, or I saw everything black or everything fully transparent. I even got a transparent drawing over the whole window. Once, when I tried compiling with gmcs, I couldn't create a cairo context with the Gdk.CairoHelper thing. I used Cairo and plain Gtk. Nothing worked. I am running Compiz Fusion, of course. Can you help? -- Stojan Dimitrovski Web: http://stojance.lugola.net/ Mail: sdimitrovski at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080131/3a6416fb/attachment.bin From ddobervich at gmail.com Wed Jan 23 17:58:43 2008 From: ddobervich at gmail.com (Dustin Dobervich) Date: Wed, 23 Jan 2008 16:58:43 -0600 Subject: [Gtk-sharp-list] Printing in Gtk# Message-ID: <101aa8890801231458i536622daq5affec60619b6285@mail.gmail.com> 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. From sdimitrovski at gmail.com Sun Jan 27 17:02:53 2008 From: sdimitrovski at gmail.com (Stojan Dimitrovski) Date: Sun, 27 Jan 2008 23:02:53 +0100 Subject: [Gtk-sharp-list] Alpha channel to widget Message-ID: <1201471373.1066.7.camel@act1v8> Hello, I've been struggling with this for a week now, it is time to ask. I need to create a Window, with a couple of widgets inside, one of which is an EventBox (or any other paintable parent widget). That parent window, the EventBox, contains it's child widgets, such as a Table and some custom widgets. Now, what I need is to give the EventBox and the table some transparency, with color of course something like, in RGBA: 1, 0, 0, 0.5... what we now would refer to Composited backround, but the custom widgets to stay intact, that is they should not catch on the alpha of the transparency. They should stay the way they are. Over the last week I tried everything I can think of. And it always proved wrong... either I saw no change, or I saw everything black or everything fully transparent. I even got a transparent drawing over the whole window. Once, when I tried compiling with gmcs, I couldn't create a cairo context with the Gdk.CairoHelper thing. I used Cairo and plain Gtk. Nothing worked. I am running Compiz Fusion, of course. Can you help? -- Stojan Dimitrovski Web: http://stojance.lugola.net/ Mail: sdimitrovski at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080127/8c4b5b8f/attachment.bin