Re: GdkColor
| From: | Steph | Date: | Wed, 06 Mar 2002 00:46:11 +0000 |
| Subject: | Re: GdkColor | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-1455@lists.php.net to get a copy of this message | ||
Yeah, copy() or creating a new GtkStyle does the trick.
Either line 18 or line 19 works, any other version colours the whole lot on prelight.
& hey, I found my # :)
<?
dl('php_gtk.'.(strstr(PHP_OS, 'WIN') ? 'dll' : 'so'));
$window = &new GtkWindow();
$window->set_position(GTK_WIN_POS_CENTER);
$window->connect_object('destroy', array('gtk', 'main_quit'));
$bbox = &new GtkVButtonBox();
$window->add($bbox);
for($i = 0; $i < 8; $i++) {
$button[$i] = &new GtkButton("This is Button $i");
$bbox->pack_start($button[$i], false);
$button[$i]->show();
}
$style = $button[5]->style;
//$newstyle = $style->copy();
$newstyle = &new GtkStyle();
$red = &new GdkColor('#FF0000');
$newstyle->bg[GTK_STATE_PRELIGHT] = $red;
$button[5]->set_style($newstyle);
$button[5]->show();
$window->show_all();
gtk::main();
?>
----- Original Message -----
From: "Adrian Immler" <a.immler@12mm.de>
To: <php-gtk-general@lists.php.net>
Sent: Tuesday, March 05, 2002 11:20 PM
Subject: [PHP-GTK] GdkColor
> somehow the colors are applied to all widgets.
>
> i use this:
>
> $button ->style->bg[GTK_STATE_ACTIVE] = $color1;
>
> if $color1 represents some kind of blue all <"inputs"> are blued ...
>
> why !?
>
> someone knows how the GdkColor works in C/C++ ? i didn't understand the
> syntax of it ...
>
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>