Re: Gtktoolbar

From: Date: Wed, 01 Sep 2004 18:41:33 +0000
Subject: Re: Gtktoolbar
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5032@lists.php.net to get a copy of this message
Hi
I'm trying to build a toolbar that displays only icons but I can't make it work. I've used GTK_TOOLBAR_ICONS both in constructor and with the set_style() method. This is a problem I encountered when documenting the class.
Andrei wrote a script which works, but only after you have clicked something: <?php if( !extension_loaded('gtk')) {
        dl( 'php_gtk.' . PHP_SHLIB_SUFFIX);
} $window = &new GtkWindow(); $window->set_title( 'toolbar test'); $window->set_default_size( 400, 70); $window->connect_object('destroy', array('gtk', 'main_quit')); $systemimage = array( '13 13 5 2', ' c None s None', '. c topShadowColor m white c lightblue', 'X s iconColor1 m black c black', 'o s bottomShadowColor m black c #646464646464', 'O s selectColor m white c red',
"                          ",
"          . . .           ",
"      . . X X X o o       ",
"    . X X X X X X X o     ",
"    . X X X X X X X o     ",
" . X X X X O X X X X o ", " . X X X O O O X X X o ", " . X X X X O X X X X o ",
"    . X X X X X X X o     ",
"    . X X X X X X X o     ",
"      o o X X X o o       ",
"          o o o           ",
"                          "
); $window->realize(); list($pixmap, $mask) = Gdk::pixmap_create_from_xpm_d($window->window, null, $systemimage); $pixmapwid = &new GtkPixmap($pixmap, $mask); $toolbar = &new GtkToolbar( GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH); //$toolbar = &new GtkToolbar( GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_TEXT); //$toolbar = &new GtkToolbar( GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_ICONS); function toolbarclicked($button, $toolbar) { $toolbar->set_orientation(GTK_ORIENTATION_VERTICAL); $toolbar->set_style(GTK_TOOLBAR_ICONS); } $toolbar->append_item( 'new', 'Creates a new document', null, $pixmapwid, 'toolbarClicked', $toolbar ); $toolbar->append_item( 'old', 'Creates a new document', null, null, 'toolbarClicked', $toolbar ); $window->add( $toolbar); $window->show_all(); gtk::main(); ?> Regards/MfG, Christian Weiske -- XMMS is playing now: Sylver - Forever In Love

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.gtk.general (#5032) next »