On Sat, Aug 05, 2006 at 10:18:24AM +0200, rupert wrote: > On 8/3/06, David Ne?as (Yeti) <[EMAIL PROTECTED]> wrote: [...] > but how can I pass all the Information like the treestore, itert.., with the > g_timeout_add(), because it only allows me one filed for data to pass.
As Yeti already pointed out, build a struct to hold it all, alloc it, pass pointer to struct (and don't forget to free when done ;-) Or, if you are sure that there's only one struct in use at a time, use a static (but this is a dirty technique which will haunt you at night, believe me). > g_timeout_add(100, crypto_mount_set_pixbuf, pixbuf_mount); > > and that's all. However, if you use some images repeatedly, > > register them as stock icons or load the pixbufs only once > > and reuse them. > > > I have no idea how to do this. > Could you please link me to an example, > from reading the reference i dont get is how to use it correctly: A quick and dirty thing I use to do (when the complexity of doing stock item things scares me -- I'm easily scared by complexity, you know) is something like: | #define NRPICS 4 | typedef enum { | sheep, | cow, | petunia, | alien | } mypic; | | static GdkPixbuf *getpix(mypic pic) | { | /* Returns pixbuf corresponding to whohas */ | static GdkPixbuf *pix[NRPICS]; | static char *fname[NRPICS] = { | "/path/to/sheep.png", | "/path/to/cow.png", | "/path/to/petunia.png", | "/path/to/alien.png", | }; | if(pic<0 || pic>alien) pic = alien; | if(!pix[pic]) /* not yet realized */ | pix[pic] = gdk_pixbuf_new_from_file(fname[pic], NULL); | return pix[pic]; | } Modify to own taste. Of course, you can get all fancy and read the list of files from a config file ant that -- but from some point on you might be better off reading up about all this stock stuff (which is far more theme-friendly), for example here: <http://developer.gnome.org/doc/API/2.0/gtk/gtk-Themeable-Stock-Images.html> HTH -- tomás
_______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list