How you can change the Color or font of a widget in Glade

Is it possible to set color or font of a widget in Glade or you should do that in the code?


Glade v3.4.1 for windows!

Glade 3.x screenshot on Win32 The prolific though anonymous author of the PHP-GTK2 Cookbook just mentioned an early build of the latest Glade for Win32 : Glade v3.4.1 for windows!

After giving the 3.x versions a spin, I can only suggest PHP-GTK2 developers already using Glade try it too, as the single-window UI improvement definitely changes impressions regarding the usability of Glade.

Fatal Fatal error: Class 'GladeXML' not found.


i installed php-gtk under kubuntu,
i used php-gtk-2.0.0beta.tar.gz
when i did ./configure, it requests me to install libglade and others packages.
on my system, i installed libglade2-0, libglade2-dev and libglade2.0cli.

Before today, i never use GTK. i would like to use glade, in order to build my interface.

I followed a tutorial which i found at but i met errors like

closing GtkDialog

I used Glade to set up the GUI for my PHP-GTK app. Everything works fine, except for closing and re-opening a GtkDialog that gets opened when clicking a button in my main window.

In my .glade-File:

<widget class="GtkDialog" id="helpwindow">

In my .phpw-File:

function onHelpClicked()

onHelpClicked() is linked to the Help button in the main window; onCloseHelpClicked() is linked to a Cancel button in the help window. Both buttons do what I expect them to do, however, when I close the help window by pushing the Esc key on the keyboard (or with the window's X button), I am not able to re-open it using the Help button - instead the app freezes and I get "Call to a member function show_all() on a non-object in ......... on line ....." (the line number is the one with show_all() in my function onHelpClicked() ).

What is the correct way to open a dialog defined in a .glade file and close it and be able to re-open it?

PHP-GTK Glade object


Does anybody know how to access the object attribute in a .glade file, i have tried googling and spent hours reading the manual, without much success. I would like to access the attribute to make my application dynamically load a class at the time the signal is sent, rather than have it all sitting in memory.

An extract from my glade file:

<signal name="clicked" handler="on_toolbarNew_clicked" object="myobject" last_modification_time="Sat, 12 May 2007 02:45:00 GMT"/>

How I envision its usage:

Fast starting with Glade 2

When you are drawing User interfaces with a nice drawing tool like glade, the main difficulty is to connect your script (callbacks) to Gtk objects with signals. Connection is achieved throught object names:

  • you need to name properly each objects in glade,
  • after that, you can reference that name in your php script.

Here is a simple auto-signal connecting system based on the names of methods. See App class example below.

Note: this article is for PHP-GTK 2, but has an equivalent for PHP-GTK 1. See Fast Starting with Glade 1

Syndicate content