RE: [PHP-GTK-DOC] create xpm: transparent color
| From: | Steph | Date: | Sun, 01 Aug 2004 05:59:25 +0000 |
| Subject: | RE: [PHP-GTK-DOC] create xpm: transparent color | ||
| References: | 1 | Groups: | php.gtk.doc |
| Request: | Send a blank email to php-gtk-doc+get-1005@lists.php.net to get a copy of this message | ||
No, that doesn't work. (No idea whether that's a GTK or PHP-GTK thing.)
Just use 'none' in the pixmap array.
"32 32 7 1",
" c none",
". c #005F00", "+ c #008A00", "@ c #00BB00",
"# c #00E000", "$ c #00F709", "% c #4BE24A",
BTW is it possible to bring the size of the pixmap array in
shape_combine_mask to anywhere it might fit onto a laptop screen?
> -----Original Message-----
> From: Christian Weiske [mailto:cweiske@cweiske.de]
> Sent: 01 August 2004 06:27
> To: PHP-GTK Doc list
> Subject: [PHP-GTK-DOC] create xpm: transparent color
>
>
> 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",
> " ",
> " ",
> " ",
> " ",
> " @@",
> " +@++",
> "+@ +@+@+ ",
> "+++ @+@++. ",
> "+@++ ++@%++. ",
> " +%++ +++%%@+ ",
> " +%@++ +++%%%++ ",
> " +@##++ +++%$$%++ ",
> " +$$%++ +++@$$$$++ ",
> " +#$$@+. +++@$$$$%++ ",
> " +@$$$#+.+.+@$$$$$#+. ",
> " .+$$$$@+.@#$$$$$@+. ",
> " +##$$$####$$$$++. ",
> " .@$#####$$###@.. ",
> " .+##########+.. ",
> " .#########+.. ",
> " .@##@#@#@.. ",
> " .+@##@#@+. ",
> " ..#@@#@.. ",
> " .@@@@.. ",
> " .+@+.. ",
> " .++.. ",
> " ... ",
> " .. ",
> " ",
> " ",
> " ",
> " ");
>
> $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...
>