[Glade-users] Problems with radio buttons in glade




Hello,

I'm currently developing a graphical application using Glade (version 3.2.0)
and the GTK library (version 2.10.something). 

I'm trying to create a GtkRadioButton menu, and I'm not being able to set a
default option using the "active" property, the Glade parser seems to ignore
it on start-up.

Then I tried a workaround, by using the "group-changed" signal, which should
be emitted when a button is added to a group of buttons, by that button. I
would use that to check in run-time if the xml has a True "active" property,
in order to set it manually, using gtk_toggle_button_set_active. However, it
also does not seem to emit any signal.

Does anybody have any clue about these two symptoms?

Thanks,

Andre'

--- Source code:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.2.0 *****-->
<glade-interface>
<requires lib="gnome"/>
<widget class="GtkDialog" id="MainWindow">
<property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
<property name="modal">True</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">2</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">1</property>
<property name="n_rows">1</property>
<property name="n_columns">1</property>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
        <widget class="GtkLabel" id="TestRadiolabel1">
                <property name="visible">True</property>
                <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
                <property name="label" translatable="yes">This will test a display / read
only mode</property>
        </widget>
        <packing>
                <property name="left_attach">0</property>
                <property name="right_attach">1</property>
                <property name="top_attach">0</property>
                <property name="bottom_attach">1</property>
        </packing>
</child>
<child>
        <widget class="GtkVBox" id="TestRadioradio1">
                <property name="visible">True</property>
                <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
<child>
        <widget class="GtkLabel" id="TestRadioradio1_label">
                <property name="visible">True</property>
                <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
                <property name="label" translatable="yes">sanity_check</property>
        </widget>
        <packing>
                <property name="position">0</property>
        </packing>
</child>
<child>
        <widget class="GtkRadioButton" id="TestRadioradio1_00">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
                <property name="label" translatable="yes">first option</property>
                <property name="draw_indicator">True</property>
                <property name="group">TestRadioradio1_00</property>
                <property name="active">False</property>
        <signal name="group-changed" handler="radiobutton_grouped_cb"/>
                <signal name="toggled" handler="radiobutton_toggled_cb"/>
        </widget>
        <packing>
                <property name="position">1</property>
        </packing>
</child>
<child>
        <widget class="GtkRadioButton" id="TestRadioradio1_01">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
                <property name="label" translatable="yes">default</property>
                <property name="draw_indicator">True</property>
                <property name="group">TestRadioradio1_00</property>
                <property name="active">True</property>
                <signal name="group-changed" handler="radiobutton_grouped_cb"/>
                <signal name="toggled" handler="radiobutton_toggled_cb"/>
        </widget>
        <packing>
                <property name="position">2</property>
        </packing>
</child>
<child>
        <widget class="GtkRadioButton" id="TestRadioradio1_02">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
                <property name="label" translatable="yes">third option</property>
                <property name="draw_indicator">True</property>
                <property name="group">TestRadioradio1_00</property>
        <property name="active">False</property>
                <signal name="group-changed" handler="radiobutton_grouped_cb"/>
                <signal name="toggled" handler="radiobutton_toggled_cb"/>
        </widget>
        <packing>
                <property name="position">3</property>
        </packing>
</child>
        </widget>
        <packing>
                <property name="left_attach">1</property>
                <property name="right_attach">2</property>
                <property name="top_attach">0</property>
                <property name="bottom_attach">1</property>
        </packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="response_id">-6</property>
<signal name="clicked" handler="gtk_widget_hide" object="MainWindow"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">gtk-ok</property>
<property name="use_stock">True</property>
<property name="response_id">-5</property>
<signal name="clicked" handler="TestRadio_"/>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>
-- 
View this message in context: 
http://old.nabble.com/Problems-with-radio-buttons-in-glade-tp27467298p27467298.html
Sent from the Gnome - Glade - User mailing list archive at Nabble.com.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]