Re: Frist steps on PHP-GTK
| From: | Scott Mattocks | Date: | Wed, 25 Aug 2004 13:43:59 +0000 |
| Subject: | Re: Frist steps on PHP-GTK | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5000@lists.php.net to get a copy of this message | ||
Ricardo Cezar wrote:
I am in my first steps with PHP-GTK, and I have a lot of questions to make. Now I'm trying to put a GtkCalendar() and a GtkButton() in a window. When I press the button, the GtkCalendar() select today's date. I can put the calendar to work. I also can put the button in the window, but one at a time. When I try to put both, only the calendar is visible. Someone can help me? I'll put the code here.From http://gtk.php.net/manual/en/gtk.gtkwindow.php: A GtkWindow object is derived from GtkBin, and can therefore only have one child widget added to it directly. To add more children it is necessary to make that child a container that can hold mulitple children. See GtkBox. You first have to add a container capable of holding more than one widget to the window and then add your calendar and button to that container. Try something like this: ... $window =& new GtkWindow;
$vBox =& new GtkVbox;$calendar =& new GtkCalendar; $button =& new GtkButton('Hoje'); $button->connect_object('clicked', 'hoje', $calendar); $vBox->pack_start($calendar); $vBox->pack_start($button) $window->add($vBox); $window->show_all(); ... Scott Mattocks