Re: Setting the color of a label

From: Date: Fri, 30 Nov 2001 15:25:58 +0000
Subject: Re: Setting the color of a label
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-780@lists.php.net to get a copy of this message
OK, here's simple: <? dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("Can't load php_gtk module!\n"); function this_function($entry) { $entered = $entry->get_text(); echo $entered."\n"; flush(); } $window = &new GtkWindow(); $window->set_position(GTK_WIN_POS_CENTER); $window->connect_object('destroy', array('gtk', 'main_quit')); $combo = &new GtkCombo(); $popdown = array('thing 1', 'thing 2', 'thing 3'); $combo->set_popdown_strings($popdown); $entry = $combo->entry; $entry->connect('changed', 'this_function'); $window->add($combo); $window->show_all(); gtk::main(); ?> ----- Original Message ----- From: <pqadmin@physicianquest.com> To: "Andrei Zmievski" <andrei@ispi.net> Cc: "Steph" <Steph.Fox@btinternet.com>; "Rich Payne" <rdp@talisman.alphalinux.org>; <php-gtk-general@lists.php.net> Sent: Friday, November 30, 2001 1:10 AM Subject: Re: [PHP-GTK] Setting the color of a label > > OK... I figured that one out looking at the doc's... Thanks. > > But one thing Im having trouble with is a GtkCombo... > > If I do it with glade I can grab the widget "combo-entry" or whatever and > get the text selected from there. However, I havent figured out how to do > this hand-coding the widgets. I dont want a ItemList like the example on > Hitchiker guide. Just something simple. > > TIA! > > > On Thu, 29 Nov 2001, Andrei Zmievski wrote: > > > At 04:06 PM 11/29/01 -0800, pqadmin@physicianquest.com wrote: > > > > >OK... I cant figure out for the life of me, how to set a GtkLabel a > > >certain color. set_style() doesnt seem to work as it does for GtkClist > > >(e.g.: set_cell_style()). > > > > > >How do I go about doing this? > > > > Labels don't have their own GdkWindows, they just render the text on the > > window of their parent. You need to add label to a GtkEventBox and then set > > the style on the box. > > > > -Andrei > > > > > > > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, e-mail: php-gtk-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-gtk-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.gtk.general (#780) next »