Re: [gtkmm] Problems with setting toolbar icon size



Today I tried to use a walkaround of my problem but it doest work.
I created a toolbutton using Image. One of the Image class constructors has option to create Image from stock and set the size of this image. Then I created ToolButton using image as icon. This is the peace of the test code:

...


void some_cb(){} ;


int main (int argc, char **argv)
{
   Gtk::Main init(argc, argv) ;


    Window*       p_new_win   = new Gtk::Window ;
    VBox*         p_vbox      = manage(new VBox()) ;
    Toolbar*      p_toolbar   = manage (new Toolbar()) ;
//creating image - in this situation small toolbar icon
Image* p_image = manage (new Image(Stock::SAVE_AS, ICON_SIZE_SMALL_TOOLBAR)) ;
//set writing on button
    Glib::ustring str_desc("bb") ;
// create button
ToolButton* p_but = manage( new ToolButton(*p_image, str_desc)) ;


                                                    p_but->show() ;
    p_toolbar->append(*p_but, sigc::ptr_fun(&some_cb));
    p_toolbar->show() ;


    p_vbox->pack_start(*p_toolbar, PACK_SHRINK, 0) ;
    p_vbox->show_all_children() ;
    p_new_win->add(*p_vbox) ;


    p_new_win->show_all_children() ;


   init.run(*p_new_win) ;


  return 0 ;
}

Nothing happen when I change the size of my Image (icon). It has still the same size. Toolbar has the same size as well.

Maybe I missunderstand something.

Thanks for any sugestions

RedBull




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