Menus and Toolbars

I have been working on Menus and can't seem to figure out Accelerators.
I've been basing the Stock icons on how Glade generates code.

Is there a way to make "File" appear with F being underlined? 

I tried ItemFactory for menus. Does it support Stock Menu icons?        

        $handlebox = new Gtk::HandleBox();
        $main_vbox->pack_start( $handlebox, $false, $false, 0 );
        $menu_bar = new Gtk::MenuBar();
        $handlebox->add( $menu_bar );
        $menu_root = new Gtk::MenuItem();
        $menu_accel = new Gtk::AccelLabel( 'File' );
        $menu_root->add( $menu_accel );
        $menu_accel->set_pattern('_    ');
        $menu_bar->add( $menu_root );
        $menu_item = Gnome::Stock->menu_item('Menu_New', 'New File');
        $menu->append( $menu_item );
        $menu_root->set_submenu( $menu );
For doing toolbars with Stock Icons:
        ( $icon, $mask ) = Gnome::Stock->pixmap_gdk( "New", "GPixmap");
        $iconw = new Gtk::Pixmap( $icon, $mask );
        $button = $toolbar->append_item("New","Add New File", "Private", $iconw
        $button->signal_connect( "clicked", sub { Gtk->exit( 0 ); } );
        $button->set_usize( 48, 0 );

Is there an ItemFactory for generating toolbars?


Best Regards,


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