Re: Menus and Toolbars
- From: Jens Luedicke <jens irs-net com>
- To: "budman" <budman intergrafix net>
- Cc: gtk-perl-list gnome org
- Subject: Re: Menus and Toolbars
- Date: Sat, 17 Mar 2001 11:52:14 +0100 (CET)
hi there ...
yes, if you are using Gnome.
$window->create_toolbar(
{
type => 'item',
label => 'New',
pixmap_type => 'stock',
pixmap_info => 'New',
callback => \&new
},
{
type => 'separator',
},
);
$window is an Gnome::App object.
----- Original Message -----
From: budman intergrafix net
To: gtk-perl-list gnome org
Cc:
Subject: 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_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?
--
with friendly regards....
jens luedicke <jens irs-net com>
PMC - Perl Mail Client
http://www.irs-net.com/
perl -le 'use Inline C=>("bool debcheck(){\n#ifdef DEBIAN\n
return TRUE;\n#endif\n}");&debcheck==0||print"This is a Debian System!"'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]