Re: [gtk-list] Re: yet another victm of lack of docs.....



On Sat, 24 Jan 1998, Ian Main wrote:

> On Sat, 24 Jan 1998, The Rasterman wrote:
> 
> > Well yet again.. I seem to be having a bad day with gtk....
> > 
> > and this one is interesting:
> >   411 root      13   0 78044  71M   768 S       0  2.5 57.6   8:35 X
> > 
> > yup.
> > xserver is sitting at 71Mb RSS.
> > 
> > and yes. its gtk.
> > 
> > I've created a gtklist wiht a whole bunch of list items.. this happens
> > when i insert like 200+ or so.... is this jus a defficienvy in gtk, or is
> > there some other widget i should use?
> > (heres the code to add one item to the list):
> 
> I'd recommend using Jay's clist.  You'll see some documentation in the
> header gtkclist.h.  It's the same one I used in the new filesel.  It's
> *WAY* faster, looks nicer IMO, and hopefully won't suffer from this
> problem. 

hmm okay. I just used the normal list.. well.. because the fileselector
used it..... thanx.. I'll give the clist a go.. :)

> > void add_file_to_list(gchar *file)
> > {
> >    GtkWidget *entry;
> > 
> >    entry=gtk_list_item_new_with_label(file);
> >    img_gui_list=g_list_append(img_gui_list,entry);
> >    gtk_object_set_data(GTK_OBJECT(entry),"data",file);
> >    gtk_widget_show(entry);
> >    current_sel=entry;
> > }
> > 
> > i took this by looking at the tutorial... and well.. it just gets HUGE
> > on the xserver side... and the filenames are like 40 chars each.. so its
> > not that....???? anywone with any ideas?
> 
> Hmm.. don't know the answer to this one..  but remember you have to free
> the data you set with gtk_object_set_data yourself.  The CList really is

I do.. there's a function elsewhere that gets called that does a foreach
on the list and frees it.. but this should a a client-side leak, not
server-side..:)

> much nicer to use - easier API too.  If you need any help with it, just
> ask. 


--------------- Codito, ergo sum - "I code, therefore I am" --------------------
raster@rasterman.com       /\___ /\ ___/||\___ ____/|/\___  raster@redhat.com
Carsten Haitzler           | _ //__\\ __||_ __\\ ___|| _ /  Red Hat Advanced
218/21 Conner Drive        || // __ \\_ \ | |   \ _/_|| /   Development Labs
Chapel Hill NC 27514 USA   ||\\\/  \//__/ |_|   /___/||\\   919 547 0012 ext 282
+1 (919) 929 9443, 801 4392   For pure Enlightenmenthttp://www.rasterman.com/ 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]