Gtk::GladeXML radiobutton grouping information loss


I noticed the following code fails to keep radiobutton grouping
information, due to my constructing the UI in several passes with a few
get_widget->pack_end(get_widget) calls...

The result is confusing, with all radiobuttons selected instead of one
per group!

The thing is, if I manually create an XML vbox and add() it to my frame,
it works fine, but makes my code even more of a mess.

Could anybody enlighten me ?



# Here's the (pseudo-)code

Gtk::GladeXML->new('','window_main' );

my $i = 1;
my $pos = tell DATA;

foreach my $source (@sources) {

    seek DATA, $pos, 0;

    my $xml_widget;
    $xml_widget = join('', (<DATA>))
    $xml_widget =~ s/##text##/$source/;
    $xml_widget =~ s/##num##/$i/;

    $xml_widget = Gtk::GladeXML->new_from_memory($xml_widget);
            "clicked", sub { $restoration->source($source); });



| David Morel <dmorel intradot com> |
|           |
| Intradot Labs                     |
| 2, rue Cuzin                      |
| F-69120 Vaulx-en-Velin            |
| tel: +33 478 80 87 90             |

Attachment: signature.asc
Description: OpenPGP digital signature

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