Re: Task list for gnome-libs-1.0
- From: Jaka Mocnik <jaka mocnik kiss uni-lj si>
- To: Martin Baulig <martin home-of-linux org>
- CC: Federico Mena Quintero <federico nuclecu unam mx>, Gnome Mailing List <gnome-list gnome org>, gnome-hackers nuclecu unam mx
- Subject: Re: Task list for gnome-libs-1.0
- Date: Tue, 24 Nov 1998 00:38:55 +0100
Martin Baulig wrote:
> >>>>
> gnome-mdi: OK, although several people think it is a bit painful to have
> to derive widgets in order to MDI-ify applications.
> <<<<
>
> What about adding something like a general GnomeMDIContainerChild widget
> and the init function gnome_mdi_container_child_new () taking a
> GnomeUIInfo for the Menu and a widget to use inside ?
>
> This would allow people to use some code like this:
>
> label = gtk_label_new (_("This is a test"));
>
> child = gnome_mdi_container_child_new (NULL, label);
I guess you meant page = gnome_mdi_...
>
> gnome_mdi_add_child (mdi, GNOME_MDI_CHILD (page));
> gnome_mdi_add_view (mdi, GNOME_MDI_CHILD (page));
this wouldn't work, you need a function returning a pointer to a widget
for a view: you couldn't create multiple views otherwise...
actually, a new widget would not be needed here: the GnomeMDIChild
object be created using gnome_mdi_child_new() function, a function that
returns a widget (passing the child an instance of a widget wouldn't
work) can be connected to "create_view" signal, similarly we can connect
"create_menus" and "get_config_string" handlers and pass GnomeUIInfo to
the child with gnome_mdi_child_set_menu_template(). the user specific
child data can be gtk_object_set_data()ed to each instance of the
GnomeMDIChild. the only difference between this approach and subclassing
is that with subclassing signal_handlers are set per class and here they
are set per object. and both work, I just find subclassing more elegant.
some convenience functions like
gnome_mdi_child_new_with_args(create_view, get_config_string, NULL,
menu_ui_info, user_data) and gnome_mdi_child_get_user_data(child) to
substitute mutiple function calls with a single one can be added, of
course. comments?
regards,
jaKa
--
email: jaka.mocnik@kiss.uni-lj.si
w3: http://pluton.ijs.si/~jaka
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]