Re: Sample simple container.
- From: Murray Cumming <murrayc murrayc com>
- To: Alexandre Moreira <alexandream gmail com>
- Cc: GTK-List <gtk-list gnome org>
- Subject: Re: Sample simple container.
- Date: Fri, 30 Mar 2007 23:47:31 +0200
On Fri, 2007-03-30 at 16:45 -0300, Alexandre Moreira wrote:
> I would like to have a way to create composite widgets without
> exposing the base Container methods (Let's say I used a box... it
> would have the box's methods and all the GtkContainer methods... and I
> wouldn't like client code to call gtk_container_add on a widget that
> is not supposed to "mean" a container)
> So, I would like to create an as-simple-as-it-gets container that
> descended only from GtkWidget so that it wouldn't really have methods
> to act like a container (Its only child widget would be set as a
> constructor parameter and overrided by its descendants).
I can offer a simpe custom container in gtkmm:
It derives from Gtk::Container, but I'd expect any container to do that.
> That way I could compose a widget using a table, a box or whatever
> layout containers and pack it inside a class, derived from that one I
> described above, that would only export the methods needed to the
> users (the GtkWidget methods and the specific Widget methods).
> Is there a better way to achieve this ? The only thing I could thought
> of was this "Basic Dumb Container" but I know it looks really bad. Is
> there a way to make a composite widget without exporting all those
> nasty GtkContainer and other containers methods ?
murrayc murrayc com
] [Thread Prev