[gtkmm] changing the font of a button



Hi,

void
on_select_font()
{
 Gtk::FontSelectionDialog dialog("Select a font");

    // Call Gtk::Dialog::run() which runs a modal
dialog
    if (dialog.run())
    {
        // Get the selected font name
     Glib::ustring font_name = dialog.get_font_name();
      
     // Modify the label's font and destroy the dialog
//lb is a pointer to Gtk::Label       
lb->modify_font(Pango::FontDescription(font_name));

//pbt2 is a pointer to Gtk::Button
pbt2->get_child()->modify_font(Pango::FontDescription(font_name));

//pbt is a pointer to Gtk::Button
pbt->get_child()->modify_font(Pango::FontDescription(font_name));
        dialog.response(Gtk::RESPONSE_OK);
    }
}

when i cal this function the font of the lb and pbt2
change but the font of the pbt doesn't change.

do i have to call get_child method for all of such
widgets which inherit from Gtk::Bin and include a
Gtk::Label or etc.. ?


=====
Koray;



		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail



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