Re: gtk builder and radio button groups user data - was Re: Which radio button is selected?



On Tue, Mar 31, 2009 at 08:28:13AM -0600, Michael Torrie wrote:
> 
> I guess I should have had a more descriptive subject line to make clear
> what I'm after.  Basically I want to know how folks using gtk builder
> are dealing with selections in gtk radio button groups.  I cannot use
> user data since gtk builder treats that as a reference to another gtk
> object in the ui xml file.

The builder model is unsuitable for widgets that form a logical group
but are packed independently.  No-one is willing to admit its
inferiority, though.  Constructing such groups programatically, e.g.
with the enum values defined in the code, does not fit the model at all.

Another example might be a slider synchronized with a spinbutton that
you do not want to compose to a single widget.

In the old days, we used to wrap such controls with some kind of API
that provided natural operations with the whole thing.

But building apps from logical components is so 20th-centurish.  Now we
have XML and push things around with a mouse.

And if this does not provoke a solution, then we are really doomed...

Yeti


P.S.: You can do at least the following things, neither of them ideal as
they both require keeping pieces of information in sync:
- leave place/placeholders in the UI definitions and replace them run
  time with programatically created widgets
- for things like radio buttons, use the object "id" attribute (together
  with an glib-mkenums generated enum, the mapping can be then done
  more or less automatically)


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