Re: Changing pixmap



> >I'm starting to program with gtk+ and glade. I want to do the following
> >thing: I have an hbox with two entries: the right entry is a toggle
> >button, and the left entry is a pixmap, say "pix1". I got this far with
> >glade, I built and compiled the program and all is well. What I want now,
> >is to change pix1 to another pixmap "pix2" when the button is toggled. I
> >know how to determine if the button is active or not, but how do I replace
> >"pix1" with "pix2"? Do I create both pixmaps from the beginning and pack
> >either one with the toggle button into the hbox and display the whole
> >thing each time the buttonn is toggled?
> >
> >The idea is to simulate a led: show some dark color when inactive, and a
> >bright color when active.

Hiya, I do something like this with gtk_pixmap_set(). I've put up a tiny
widget from my app:

	http://cima.ng-london.org.uk/~john/led/

HTH, John




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