• 26 May 2013 - Since the new version attracted too many spammy registrations (around 250 fake accounts/day), user registrations are now protected by Mollom's spam protection service. Contact us if this causes some trouble.
  • 01 May 2013 - After the site upgrade, all passwords were reset and you will need to ask the site for a login reset on your first connection.

GladeXML

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?

Thanks
Mohsen

Fatal Fatal error: Class 'GladeXML' not found.

hi,

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 http://gtk.php.net/manual/en/tutorials.helloglade.preparation.php 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">
.....
</widget>

In my .phpw-File:

<?php
function onHelpClicked()
    {
        global
$window;
       
$window->get_widget('helpwindow')->show_all();
    }
    function
onCloseHelpClicked()
    {
        global
$window;
       
$window->get_widget('helpwindow')->hide_all();
    }
?>

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

Hi,

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

GtkHtml and Glade

Hi, there is a way to use the gtkhtml component with glade / phpgtk.

In glade, create a GtkScrolledWindow and add a Custom component with gtk_html_new as creation function name.

Condividi contenuti