Multiple Document Interface system ?

23 views
Skip to first unread message

Lucas Sanner

unread,
Aug 11, 2025, 8:03:14 AMAug 11
to fltk.general
Hi all,
In my FLTK application I would need a MDI system. Something similar to Photoshop interface: The child windows can be moved freely only inside the main window. You can open several child windows inside the main window. When minimizing, their title bars aligned well at the bottom of the border of the main window.
A Fl_MDI widget was once developed but it's gone now (links are dead).

I may create a custom draggable mini-window widget out of Fl_Group, Fl_Box...  
I guess I'd also need a kind of second focus hierarchy specific to child windows.
But before getting into it I'd like your advice on the best option to achieve an MDI system in FLTK.
A simple code example would be appreciate.

Thanks for your help.

imm

unread,
Aug 11, 2025, 8:35:42 AMAug 11
to General FLTK
Have you checked Greg's examples? 
ISTR he has examples for this, or at least for movable groups anyway, which maybe a useful starter.

That said, MDI seems to be deprecated as a gui idiom these days, so maybe there's a "better" way?
--
Ian
From my Fairphone FP3

Albrecht Schlosser

unread,
Aug 11, 2025, 9:21:36 AMAug 11
to fltkg...@googlegroups.com
There is no "simple code example" for what you want. You can easily use
Fl_Tabs to create a simple MDI system (each tab can contain one
document), but dragging windows around and "docking" is not a simple
task. That's why I wrote that there is no "simple" example.

However, there have been at least two discussions (or issues) on GitHub
[1] recently (say: in the last two or three months) about
implementations of draggable and dockable windows. You may take a look
at that to get an impression how complicated all this is, particularly
Wayland support because Wayland hides window coordinates...

Warning: this is all work in progress!

See also examples/draggable-group.cxx in the FLTK sources.

[1] https;//github.com/fltk/fltk -> Discussions or Issues

Albrecht Schlosser

unread,
Aug 11, 2025, 9:40:19 AMAug 11
to fltkg...@googlegroups.com
On 8/11/25 15:21 schrieb 'Albrecht Schlosser' via fltk.general:
> However, there have been at least two discussions (or issues) on
> GitHub [1] recently (say: in the last two or three months) about
> implementations of draggable and dockable windows. You may take a look
> at that to get an impression how complicated all this is, particularly
> Wayland support because Wayland hides window coordinates...
>
> [1] https;//github.com/fltk/fltk -> Discussions or Issues

Sorry for the wrong link (typo). Please use this instead:
https://github.com/fltk/fltk/discussions?discussions_q=is%3Aopen+dock

The first three (of four) hits are on topic (as of today), the "fluid"
one is not helpful for this question.


Ian MacArthur

unread,
Aug 11, 2025, 9:54:47 AMAug 11
to fltk.general
On Monday, 11 August 2025 at 14:21:36 UTC+1 Albrecht-S wrote:
There is no "simple code example" for what you want. You can easily use
Fl_Tabs to create a simple MDI system (each tab can contain one
document), but dragging windows around and "docking" is not a simple
task. That's why I wrote that there is no "simple" example.

However, there have been at least two discussions (or issues) on GitHub
[1] recently (say: in the last two or three months) about
implementations of draggable and dockable windows. You may take a look
at that to get an impression how complicated all this is, particularly
Wayland support because Wayland hides window coordinates...

FWIW, a long time ago (think it was back in the 1.1 era, might even have been 1.0 I suppose...) I had a stab at this - though that project fell out of favour and I can not now find the code.

FWIW, my MDI "windows" were actually groups, IIRC, not real "windows" at all, so the Wayland aspect might not be a problem if you go that way. At the time I _think_ this was due to some issues with nesting windows (possibly on older versions of OSX?)  Don't really recall.

Anyway, this meant the the per-window co-ordinates were a real pain to figure out (they couldn't just be window-relative) and I also had to draw my own window decorations, so they never really looked quite like the "native" widgets anyway.

I honestly don't think it's worth the effort!


Lucas Sanner

unread,
Aug 12, 2025, 4:30:10 AMAug 12
to fltkg...@googlegroups.com
Thank you guys for your help and advice.
After checking out Albrecht's link I think I'm gonna drop the MDI system idea and go for a TDI (Tabbed Document Interface) system instead.
An MDI system is indeed too complex and tricky to set up. Conversely, a TDI system seems easier to achieve (through Fl_Tabs) and rules out the complexity of draggable and dockable widgets.

--
You received this message because you are subscribed to a topic in the Google Groups "fltk.general" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fltkgeneral/6MN3HnKkIkM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fltkgeneral...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/fltkgeneral/71d41efb-8777-4c76-965f-e8e8ee8bd579n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages