Re: GtkColorButton proposal
| From: | Jp | Date: | Sun, 18 Dec 2005 17:08:39 +0000 |
| Subject: | Re: GtkColorButton proposal | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2123@lists.php.net to get a copy of this message | ||
Steph Fox escreveu:
> Hi all,
>
> I'd like to kill off gtk_color_button_new_with_color() completely (put
> it in
> the ignores) and instead have GdkColor as an optional param in the
> GtkColorButton constructor.
>
If my vote has any weight, I vote for it. Why stick with GTK if we can
make it *The PHP Way*(tm).
Also, I've been wondering about the GdkColor constructor...
Supplying it with RGB values must be very rare, personally I belive it
would be nice to have it accept strings as parse() method does,
something like:
$red = new GdkColor("red");
$red = new GdkColor("#ff0000");
> I have a trivial patch to make GtkColorButton::get_color() work in the
> expected manner too.
>
Great, this method had a weird syntax...
> With both patches in, this test script currently works on my laptop:
>
> <?php
>
> function test_this($cb) {
> $color = $cb->get_color();
> var_dump($color);
> }
>
> $window = new GtkWindow();
> $window->connect_simple('destroy', array('gtk', 'main_quit'));
>
> $color = new GdkColor();
> $red = $color->parse("red");
>
> //$cb = new GtkColorButton($red); // either construction works
> $cb = new GtkColorButton();
> $cb->connect('clicked', 'test_this');
> $window->add($cb);
>
> $window->show_all();
> gtk::main();
>
> ?>
>
> Anyone have strong feelings for/against this?
>
> - Steph
>
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc