<?php
dl("php_gtk." . (strstr(PHP_OS, "WIN") ? "dll" :
"so"));
$window = &new GtkWindow();
$window->set_position(GTK_WIN_POS_CENTER);
$window->connect_object("destroy", array("gtk",
"main_quit"));
/* create the calendar and add it to the window. */
$calendar = &new GtkCalendar();
$window->add($calendar);
/* create a new style for the calendar, based on the old one */
$oldstyle = $calendar->style;
$newstyle = $oldstyle->copy();
$font =
gdk::font_load('-unknown-Arial-normal-r-normal--*-160-*-*-p-0-iso8859-1');
$red = &new GdkColor(255*255, 0, 0);
$newstyle->font = $font;
$newstyle->fg[GTK_STATE_SELECTED] = $red;
$calendar->set_style($newstyle);
/* have today's date highlighted on opening */
$calendar->select_day(date('d'));
$window->show_all();
gtk::main();
?>
|