Re: Evolving ComboBox API



> > - The name egg_combo_box_new_text() is badly chosen, we need another
> > name for this. Maybe something like egg_combo_box_simple_new(),
> 
> My suggestion is:
> 
>  egg_combo_box_new_text() as now
>  egg_combo_box_entry_new()
> 
> You can have an EggComboBox with text in it, the distinctive thing
> about the current EggComboBoxText is that it is *editable* text.

I completely agree.

> 
> > - The pixtext convenience handlers, which would provide easy API for
> > creating option menus with pixbuf, text pairs has been dropped. I still
> > think that this code can be useful, others don't.
> 
> Putting flags by the country names is crack, as much as people want
> to do it. We should make them pay for it just a _little_ bit.
> With the raw API, doing pixmap/text pairs will still be easier
> than creating a GtkTreeView with pixmap/text pairs, so I think
> it counts as easy.

Ok, then I will write a good example instead (:.

> 
> >  /* 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()?

> 
> >  /* 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.

> 
> > void egg_combo_box_set_span_columns (EggComboBox     *combo_box,
> >                                      gint             width_column,
> >                                      gint             height_column);
> 
> Free prize for whoever can figure out what this should be called
> so as not to confuse the heck out of everybody who looks at the
> header file.
> Maybe set_span_model_column(); int width_model_column; int height_model_column.

_set_size_info_columns()
_set_layout_parameter_columns() ... prolly too long.
_set_layout_info_columns().

I guess neither of those makes the situation better...

> 
> 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.



	-Kris

> 
> Regards,
>                                        Owen
> 
> 
> 
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list



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