We will concentrate on doing things with Glade, not designing a sophisticated interface. That's why the example .glade file is pretty simple; a window with a single button in it.
The window gets the name (id) wndClose, and the button receives the name btnClose.
Example 4.1. The example .glade file - helloglade.glade
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkWindow" id="wndClose">
<property name="visible">True</property>
<property name="title" translatable="yes">Close me</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="destroy" handler="gtk::main_quit"/>
<child>
<widget class="GtkButton" id="btnClose">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="onClickButton"/>
</widget>
</child>
</widget>
</glade-interface>
|