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



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. 

> 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
much nicer to use - easier API too.  If you need any help with it, just
ask. 


	Ian




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