Re: ToggleButton Change Icon



* William B Carlson <carls107 msu edu> [2004-08-24 15:13]:
I have ToggleButton, which is used to start and stop a process.
I was wondering if there was a way to use the stock icons
(gtk-start, gtk-stop) in place of the Start and Stop text. 

Per my reading of the Gtk2::Button docs from which ToggleButton
inherits, if you do

    $button->set_use_stock( TRUE );

then any label you set will be interpreted as the stock item
name.

So you'd do that once at instantiation, then set the label to
'gtk-start' or 'gtk-stop', and get the desired effect.

Regards,
-- 
Aristotle
"If you can't laugh at yourself, you don't take life seriously enough."



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