Multiple views per GnomeMDIChild



Hullo,

As far as I can see, GnomeMDIChild and GnomeMDIGenericChild
only support a single type of view each.  If you use the
following function to add views:

 GtkWidget* gnome_mdi_child_add_view(GnomeMDIChild *mdi_child);

there's no room for view-specific parameters.  For example,
let's say I create a (generic) child to display graphic
images.  Presumably, the GnomeMDIChild object holds the
data, i.e. the document, for the image -- I suppose I could
use gtk_object_set_data() to attach it to the GnomeMDIChild.
Anyway, let's say I want to have two different views of this
same graphics object, a preview of it, and also a view with
statistics about the object (i.e. file name, size, dimensions).
How would I load each of these views?  The add_view() function
doesn't allow me to pass anything except the child.  This
implies that each child can only have one type of view.  If
this is the case, why bother with loading more than one 
identical view per child?

The only way I can figure out to get this to work is by 
setting some state in the GnomeMDIGenericChild before
creating each new view, something like this:

 set_child_creation_mode(child, GRAPHICAL_VIEW);
 gnome_mdi_child_add_view(child);
 set_child_creation_mode(child, INFO_VIEW);
 gnome_mdi_child_add_view(child);

But that's downright ugly.  The MDI API should allow for this
without hacking around it like that.

The only other thing I can think of right now is that
multiple views per child aren't meant to be used with
GnomeMDIGenericChild objects, and only really make sense
if you derive your own MDIChild widgets.

Whew, that was longer than I intended.  Anyone have insight
on this?  Jaka?

Thanks,
John



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