create xpm: transparent color
| From: | Christian Weiske | Date: | Sun, 01 Aug 2004 05:26:45 +0000 |
| Subject: | create xpm: transparent color | ||
| Groups: | php.gtk.doc | ||
| Request: | Send a blank email to php-gtk-doc+get-1003@lists.php.net to get a copy of this message | ||
Hi
Could somebody confirm that the following example doesn't work (transparent color)?
The black color (space) should be transparent on the button...
<?php
if( !extension_loaded('gtk')) {
dl( 'php_gtk.' . PHP_SHLIB_SUFFIX);
}
$arXPMs['ok'] = array(
"32 32 7 1",
" c #000000",
". c #005F00", "+ c #008A00", "@ c #00BB00",
"# c #00E000", "$ c #00F709", "% c #4BE24A",
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
" ", " ", " ", " ", " @@", " +@++", "+@ +@+@+ ", "+++ @+@++. ", "+@++ ++@%++. ", " +%++ +++%%@+ ", " +%@++ +++%%%++ ", " +@##++ +++%$$%++ ", " +$$%++ +++@$$$$++ ", " +#$$@+. +++@$$$$%++ ", " +@$$$#+.+.+@$$$$$#+. ", " .+$$$$@+.@#$$$$$@+. ", " +##$$$####$$$$++. ", " .@$#####$$###@.. ", " .+##########+.. ", " .#########+.. ", " .@##@#@#@.. ", " .+@##@#@+. ", " ..#@@#@.. ", " .@@@@.. ", " .+@+.. ", " .++.. ", " ... ", " .. ", " ", " ", " ", " ");$window = &new GtkWindow(); $window->set_title( 'pixmaps'); $window->set_default_size( 400, 400); $window->connect_object('destroy', array('gtk', 'main_quit')); $window->realize(); $clTransparentTest = &new GdkColor( '#000000'); $arPxTest = Gdk::pixmap_create_from_xpm_d($window->window, $clTransparentTest, $arXPMs['ok']); $btnTest = &new GtkButton(); $pxmTest = &new GtkPixmap( $arPxTest[0], $arPxTest[1]); $lblTest = &new GtkLabel( 'Button with icon'); $hboxTest = &new GtkHBox(); $hboxTest->add( $pxmTest); $hboxTest->add( $lblTest); $btnTest->add( $hboxTest); $tblMain = &new GtkTable(3,3); $tblMain->attach( $btnTest, 0, 1, 0, 1, GTK_SHRINK, GTK_SHRINK); $window->add( $tblMain); $window->show_all(); gtk::main(); ?> Regards/MfG, Christian Weiske -- XMMS is playing now: Tocotronic - Alles was ich will, ist...
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc