To: stalkern2 at tin.it Cc: lablgtk at kaba.or.jp Subject: Re: clists, packing beyond viewport, gtk notebook In-Reply-To: <200305231742.54903.stalkern2 at tin.it> References: <200305231742.54903.stalkern2 at tin.it> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030524101032B.garrigue at kurims.kyoto-u.ac.jp> Date: Sat, 24 May 2003 10:10:32 +0900 From: Jacques Garrigue Lines: 60 From: Stalkern 2 > I'm (still) in GTK 1.2 and I'm using clists. > I found out that clists are discarded in GTK2 but I don't know why yet. Just because the new tree widget is more powerful :-) But it may be a good idea to put them back in lablgtk2, as APIs are very different. > 1) I'm looking for putting a sorting callback on the TITLES: before I start > working on it for a week, I'd like to ask ;-) is it feasible with lablgtk? is > there any code that I should read? I see some sorting functions but I still > have to try them out and in any case I still have to see the whole thing in > practice. I remember doing it once, but I don't remember where is my code :-) Basically you just have to use the #set_sort method, but you have only lexicographical sort. (GTK2 allows defining you own sorting function) > 2) Right now, 'm looking for a lablgtk-ish translation of the following: (a > FAQ from http://www.gtk.org/faq/ ) > ---------------------------------------------------------------------------------------- > 6.2. How do I stop the column headings of a GtkCList disappearing when the > list is scrolled? > > > How do I stop the column headings of a GtkCList disappearing when the list is > scrolled? > > > This happens when a GtkCList is packed into a GtkScrolledWindow using the > function gtk_scroll_window_add_with_viewport(). The prefered method of adding > a CList to a scrolled window is to use the function gtk_container_add, as in: > > > GtkWidget *scrolled, *clist; > char *titles[] = { "Title1" , "Title2" }; > > scrolled = gtk_scrolled_window_new(NULL, NULL); > > clist = gtk_clist_new_with_titles(2, titles); > gtk_container_add(GTK_CONTAINER(scrolled), clist); For me the direct translation works: let scrolled = GBin.scrolled_window () let clist = GList.clist ~titles:["Title1";"Title2"] ~packing#scrolled#add () Of course, if you have already put something in the scrolled window, you must remove it first, otherwise you get an error: > exception Gtk.Error ("GContainer.container#add: already full") > 3) Another question: is the use GTK notebook a bad GTK > practice? I found it out by chance, so I'm wondering if it's clumsy somehow. Why? If it's there, I suppose it can be used, no? Cheers, Jacques