Re: Dev_GuiInspector
| From: | Scott Mattocks | Date: | Fri, 27 Jan 2006 18:06:21 +0000 |
| Subject: | Re: Dev_GuiInspector | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6570@lists.php.net to get a copy of this message | ||
Christian Weiske wrote:
First, base defines the background for a GtkEntry not bg. Second, you can modify the style at runtime using GtkWidget::modify_<property>(). Example: <?php $window = new GtkWindow(); $window->connect_simple('destroy', array('Gtk', 'main_quit')); $entry = new GtkEntry(); $window->add($entry); $window->show_all(); // Change the base property of the entries style. $entry->modify_base(Gtk::STATE_NORMAL, GdkColor::parse('#F00')); Gtk::main(); ?> -- Scott Mattocks http://www.crisscott.com- Finally, the GtkEntry doesn't highlight when I click on it. Maybe you can change the style to as a back up if the draw_rectangle doesn't do anything.If you show me how to change the background color of a gtkentry *after* it has been realized and shows, I'll do this - I spent half an hour, but got no solution. Setting the bg before it's shown is easy, but not after (at least not for me). People write that this should work:$rcstyle = $widget->get_modifier_style(); $rcstyle->fg[Gtk::STATE_NORMAL] = new GdkColor(255,0,0); $rcstyle->color_flags[Gtk::STATE_NORMAL] |= Gtk::RC_FG; $widget->modify_style($rcstyle);But that doesn't do it. And a simple$style = $entry->get_style(); $style->bg[Gtk::STATE_NORMAL] = GdkColor::parse('#FF0'); $entry->set_style($style);doesn't work neither.