GdkGC constructor
| From: | Andrei Zmievski | Date: | Tue, 28 Feb 2006 04:08:39 +0000 |
| Subject: | GdkGC constructor | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-2446@lists.php.net to get a copy of this message | ||
How should we implement GdkGC constructor? Leave it bare, so you just pass the GdkDrawable and set all the properties via set_* functions or directly via ->property? Or make it possible to pass some properties in the constructor, as version 1 did? And if so, should it be just a long list of parameters or just an associative array? I guess what I'm asking is which of these 3 choices is more appealing:
Choice1
$gc = new GdkGC($window);
$gc->set_foreground(...);
$gc->set_background(...);
$gc->set_line_attributes(...);
or
$gc = new GdkGC($window);
$gc->foreground = ...;
$gc->background = ...;
$gc->line_width = ...;
Choice 2
$gc = new GdkGC($window, $foreground, $background, $font, $function, ...);
Choice 3
$gc = new GdkGC($window, array('background' => $background, 'line_width' => $width));
Note that choice 2 or 3 don't preclude changing the properties later as shows in choice 1.
I guess we could also have choice 4.
$gc = $window->new_gc(... values ..);
-Andrei