Re: [gtk-list] Re: clist titles

On Thu, Jan 15, 1998 at 09:26:47AM -0500, Michael K. Johnson wrote:
> Paolo Molaro writes:
> >See the gtkcombo widget in the contrib dir on
> >It allows two column elements (there is an example for that).
> Yes, that's nice.  The two-column element is definitely what I am
> looking for.  :-)
> It looks to me like the programming interfaces of the gtkcombobox and
> your gtkcombo widget are mostly orthogonal, and could be combined into
> one widget.  The simple list functionality of the combobox is kind of
> nice for when that's all you need.
> Would you be interesting in extending your interface slightly so that
> it's easy to take code written to gtkcombobox and move it over to
> your combo widget?  If you could do that, I think everyone here would
> be quite willing to change the combobox widget in gtk to be yours...
> That's two things: maintaining a simple GList of text strings as one
> way to populate and update the widget (should map to your widget

This can be done with a convenience function that mimics gtkcombobox

> pretty easily, right?) and adding a max size for the entry widget,
> which should be a few lines of code copied from gtkcombobox.c.

I submitted a patch for the entry widget that adds the function
gtk_entry_set_max_length. This is the way to go, IMHO, so you can
change the max_text_len at any time and not only in the
constructor: with this you could call 
	gtk_entry_set_max_length(combo->entry, whatever);
and any composite widget that uses an entry or a descendant of
gtkentry shouldn't provide to constructors only to set a variable...
Think if you develop a composite widget that has 3 entries in it
and the programmer who wants to use your widget needs the
max_length feature in the entries. With my patch the
programmer can call 
	gtk_entry_set_max_length(widget->entry[i], whatever);
with i in 0 .. 2.
Without it you have to provide 3^2 constructors, gosh!!!


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