Re: [PHP-GTK] gtkcalender
[email protected] (Rich Payne)
| Newsgroups | php.gtk |
|---|---|
| Message-ID | <[email protected]> |
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
[email protected] www.alphalinux.org