Menus and Toolbars
- From: "budman" <budman intergrafix net>
- To: gtk-perl-list gnome org
- Subject: Menus and Toolbars
- Date: 16 Mar 2001 22:23:32 EST
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_bar->show();
#----------------------------------------
$menu_root = new Gtk::MenuItem();
$menu_accel = new Gtk::AccelLabel( 'File' );
$menu_accel->show();
$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_item->show();
$menu_item->set_sensitive(1);
#----------------------------------------
$menu_root->set_submenu( $menu );
$menu_root->show();
$handlebox->show();
#----------------------------------------
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 );
$toolbar->append_space();
Is there an ItemFactory for generating toolbars?
--
Best Regards,
Budman
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]