Re: Emulating MDI



On 1/12/07, Robert Pearce <rob bdt-home demon co uk> wrote:
So, is there a convenient way I can re-create that look in a GTK app?
There's no corresponding standard widgets - the only standard widget

No, there's not really an equivalent. This is usually justified on
usability grounds, plus the difficulty of implementing MDI in a sane
way on multiple platforms.

In my experience, your options are:

1) Use multiple top-level windows instead

I think this is the recommended route. If you use a reasonable window
manager, it will group them for you and they will behave rather like
an MDI program (except without the solid grey container). This doesn't
work so well if you build for win32 sadly.

2) Use tabs in a gtknotebook

The second easiest. Not quite MDI, but quite close, and simple to
implement. Put each window into a separate page of the notebook and
put the tabs at the bottom of your main window.

3) Make your own MDI widget

A lot of work, but some people have done this. You use a gtkfixed
widget for positioning, then put a gtkeventbox in for each sub-window,
and put your window contents inside that. You need to write the code
to draw the title bars, implement drag/minimise/maximise/close,
restore windows on load/save, theme to match the host system's window
manager, etc etc.

I have something (a little) like this in my (GPL) app, you're welcome
to steal code if it's any use:

 http://www.vips.ecs.soton.ac.uk

John



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