Re: Evolving ComboBox API



On Wed, 2003-04-23 at 19:24, Kristian Rietveld wrote:

> > >  /* signals */
> > >  void     (* popped_up)        (EggComboBox *combo_box);
> > >  void     (* popped_down)      (EggComboBox *combo_box);
> > >  void     (* changed)          (EggComboBox *combo_box);
> > 
> > I'll repeat my earlier call to eliminate popped_up/popped_down
> > (I don't see the use case) and to add a
> > 
> >  gboolean (* activate) (EggComboBox *combo_box);
> > 
> > where the *default* action is to set_activate(), which then
> > emits ::changed.
> 
> What would _set_activate() do? Or did you mean _set_active()?

I meant set_active().

> > >  /* vtable */
> > >  void     (* set_active)       (EggComboBox *combo_box,
> > >                                 gint         index);
> > >  gint     (* get_active)       (EggComboBox *combo_box);
> > 
> > Do these need to be virtualized, or can you (with my above
> > scheme), just do what's needed out of the default handlers
> > for ::activate and ::changed?
> 
> Some ComboBoxes deriving from EggComboBox need a way to override the
> default implementation. For example in EggComboBoxEntry it can happen
> that the text entered in the entry is not in the GtkTreeModel. In that
> case you would want _get_active() to return -1 for example. I guess
> people can come up with more use cases for this.

To handle the -1 case, I'd just support set_active (combo_box, -1);
I think "none active" is fairly natural as a state. So, the
question is *can* people come up with more use cases for this.

> > I wonder if we should add:
> > 
> >  GtkEntry *egg_combo_box_entry_get_entry(EggComboBoxEntry *combo_box_entry);
> > 
> > to keep from having to continually point people to gtk_bin_get_child().
> 
> I don't have any strong objections, but maybe a small note in the header
> file as Jonathan suggests might be better.

Don't feel strongly here.

Regards,
                                                       Owen





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