red / REP

Red Enhancement Process
BSD 3-Clause "New" or "Revised" License
10 stars 4 forks source link

Q: Should Red allow windows to be attached to other windows? #81

Open hiiamboris opened 4 years ago

hiiamboris commented 4 years ago

In the current build this is a bit crash-prone, but it kinda works. view [p: panel [] do [append p/pane layout [button]]]

Currently it gives no advantages, but I can imagine a few separate windows being dragged as one, and being closed/minimized/hidden as soon as the parent window is closed/minimized/hidden.

What would be the best way to handle the above code?

  1. Like R2 - append the contents of the pane instead of the window itself
  2. Support windows within windows and give them some special properties (dunno how portable this is or how much effort requires)
  3. Raise an error
greggirwin commented 4 years ago

For those who are too young to remember MDI, this is how MS tried to solve it. Many other approaches exist as well. None are universally good. It seems best to do this the simplest way possible, by building a system that allows you to declare window relationships, handle events for them based on that, and use plain old windows for everything. Then we can make toolboxes, file pickers, plugins for apps, and have a well defined API for coordinating them.

greggirwin commented 4 years ago

Drag and drop is another subsystem to consider here, and breaking things apart means it can work across apps as well, like file dragging in an OS.