Re: gtkcalender
| From: | Rich Payne | Date: | Thu, 26 Jul 2001 12:31:29 +0000 |
| Subject: | Re: gtkcalender | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-2356@lists.php.net to get a copy of this message | ||
On Wed, 25 Jul 2001, Daniel Adams wrote:
> has the GtkCalender class not been implemented in phpgtk? i do
> $due_cal->get_date (&$year, &$month, &$day); and it doesn't set the vars.
> Am I just doing it wrong? :-)
> - Dan
You need to look at what get_date() returns, it will give you an array of
the day/month/year. You don't need to pass it anything. here's a small
example:
<?php
dl('php_gtk.so');
$win = &new GtkWindow();
$box = &new GtkVBox();
$cal = &new GtkCalendar();
$box->add($cal);
$btn = &new GtkButton("Get Date");
$btn->connect('clicked',show_date,$cal);
$box->add($btn);
$win->add($box);
$win->show_all();
Gtk::main();
function show_date ($widget,$cal) {
$test=$cal->get_date();
echo "Day is $test[1] $test[2] $test[0] \n";
}
?>
--rdp
--
Rich Payne
rpayne@alphalinux.org www.alphalinux.org