[gtkmm] Re: Button question



>Hello there !
>>
>> I need to create a button containing an stock image (built in GTK),
>> like Gtk::Stock::CANCEL.
>> If I pass Gtk::Stock::CANCEL to the button's constructor, then the
>> button contains the image AND the text (cancel).
>> How can I avoid the button to display the text ?
>>


Use the Gtk::Button::add_pixlabel() member function to set the pixmap
and optional text you want(or don't) displayed.  See the example
program:

gtkmm/examples/book/buttons/button

----

Thanks Billy for your quick answer.
Unfortunatly, this was not exactly what I needed. The add_pixlabel requires an external file (.xpm). I finally created a Gtk::Image containing the stock icon, and added it to the button.
Thanks a lot anyway, and keep answering :-)
Ben






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