Re: [gtk-list] combo box: entry as a container?
- From: Owen Taylor <owt1 cornell edu>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] combo box: entry as a container?
- Date: 25 Sep 1997 16:43:25 -0400
Stefan_Wille@public.uni-hamburg.de writes:
> Of course I could make combo box a descendant of container (or hbox),
> but then one couldn't use the calls of entry class to manipulate it.
> Which would be most comfortable and intuitive.
I don't think
gtk_entry_set_text(GTK_ENTRY(GTK_ENTRY(combobox)->entry),"text");
is too bad (well, it would be better in anything but C
$combobox->entry->set_text("text") )
And it would certainly make things easier to implement.
In about twenty lines of code, it would also be possible to provide
gtk_combo_box_set_text(...)
and wrappers for the other three entry specific functions.
> The same problem occurs if somebody tries to build a spinner
> widget (an entry with two small up/down buttons to the right to
> select ordered values like numbers or weekdays).
>
> Maybe entry could become a container widget? This may sound bizarre,
> but button is a container allready.
With buttons, being a container makes sense ... the contained area is
part of the widget. With entries it seems rather artificial to say
that an entry contains something ... Not that it would be too hard to
implement - (you would have to change _draw(), _expose(),
size_allocate(), and size_request()).
But I'm not at all sure that it is worth the extra complexity - it's
not like there are millions of lines of code out there in which every
entry has to be changed to a combobox. It seems in general more
flexible to just make the ComboBox widget contain an entry.
> Another option would be to allow every to be a container,
> as it is the case in the Qt widget set. One would simply merge
> the methods of GtkContainer into GtkWidget and change 'parent's
> type from GtkContainer to GtkWidget . This would be a cleaner approach,
> but is a major design decision to be made.
Uggh. That's a quite a bit of extra bloat for every widget. And if you
think about it, you really don't want the Entry widget to be just a
Container, you want it to be a Bin. But if you really want to do it
and need more information about writing container widgets, let me
know. (Anybody have any ideas for a container widget example for the
widget-writing tuturial?)
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]