cvs: php-gtk-doc /en/reference/gtk gtklabel.xml

From: Date: Fri, 23 Jul 2004 08:42:16 +0000
Subject: cvs: php-gtk-doc /en/reference/gtk gtklabel.xml
Groups: php.gtk.doc 
Request: Send a blank email to php-gtk-doc+get-916@lists.php.net to get a copy of this message
cweiske Fri Jul 23 04:42:16 2004 EDT Modified files: /php-gtk-doc/en/reference/gtk gtklabel.xml Log: Example changes styles now - that the newbies don't ask in the mailing list any more. http://cvs.php.net/diff.php/php-gtk-doc/en/reference/gtk/gtklabel.xml?r1=1.13&r2=1.14&ty=u Index: php-gtk-doc/en/reference/gtk/gtklabel.xml diff -u php-gtk-doc/en/reference/gtk/gtklabel.xml:1.13 php-gtk-doc/en/reference/gtk/gtklabel.xml:1.14 --- php-gtk-doc/en/reference/gtk/gtklabel.xml:1.13 Sun Aug 3 13:09:22 2003 +++ php-gtk-doc/en/reference/gtk/gtklabel.xml Fri Jul 23 04:42:16 2004 @@ -43,21 +43,34 @@ <programlisting role="php"> <![CDATA[ <?php - -dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')); +if( !extension_loaded('gtk')) { + dl( 'php_gtk.' . PHP_SHLIB_SUFFIX); +} $window = &new GtkWindow(); -$window->set_usize(200, 200); +$window->set_default_size(300, 70); $window->connect_object('destroy', array('gtk', 'main_quit')); -/* Child widgets by default will expand to fill the available space */ $label = &new GtkLabel("This is my label"); +//move it to the lower right $label->set_alignment(1.0, 1.0); + +//give it a nice font and color +$style = $label->get_style(); +$style->font = gdk::font_load( '-*-Arial-bold-r-normal-*-24-*-*-*-*-*-*-*'); +$orange = &new GdkColor( '#FF8000');; +$style->fg[GTK_STATE_NORMAL] = $orange; +$label->set_style( $style); + +//you can't set the background color of a label, use the parent widget instead +$wstyle = $window->get_style(); +$wstyle->bg[GTK_STATE_NORMAL] = $wstyle->black; +$window->set_style( $wstyle); + $window->add($label); $window->show_all(); gtk::main(); - ?> ]]> </programlisting>

« previous php.gtk.doc (#916) next »