Re: [gtk-list] MDI type application



>I'm trying to create a MDI application (small text editor).
>
>I can't figure ouut how to make child frame that belongs to a parent frame.
>
>Can someoe give me a simple exemple or point me to a sample?

You can't do this, or if you can, only by using nasty hackery.

The reason why not is because the windowing system in X is not part of the 
widget set, it's an external program. The window manager only manages windows 
that are children of the root window, it can't do anything about windows that 
are children of other windows. If you really wanted to do Windows-style MDI, 
you'd have to write a GTK widget that acted like a window manager, and as you 
don't know what window manager the user is using, it's user interface would be 
totally different and therefore confusing.

In practice this is not a restriction, anyway. Windows-style MDI, with 
multiple windows being children of a single parent window, is inherently evil 
(or at least I think so). It means that you have huge parent windows covering 
large areas of the desktop, covering everything below; with a focus-on-pointer 
system like X usually is, this means that the user has to manually lower or 
raise the parent window to get access to anything underneath, which takes 
time. And if you start trying to have two subwindows in *different* MDI 
applications visible at once, you need to start resizing the parent window and 
shuffling the subwindows around, and you run the risk of losing a subwindow 
that's nominally in the centre of the screen because you've resized the parent 
so it's not visible... this is horrific, ergonomically.

The way X and GTK does MDI is to use multiple primary windows. Each primary 
gets an identical set of menus. Selecting File->New creates a new primary. You 
can use the Window menu on any primary to view the list of documents open or 
switch to one. The application exits when the last primary is closed. Take a 
look at nedit for a good example.

I believe that Gnome contains an MDI class that will do all of this for you.


-- 
+- David Given ---------------McQ-+ "There is only one thing worse than war,
|  Work: dg@tao-group.com         | and that's business. Spacely has declared
|  Play: dgiven@iname.com         | business on us." --- Cogswell              
+- http://wired.st-and.ac.uk/~dg -+ 




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