show() permnant on-top

50 views
Skip to first unread message

Rob McDonald

unread,
Jun 24, 2016, 1:54:41 PM6/24/16
to fltk.general
Lets say I have windows A and B.  A is currently visible and B is not.  Both A and B are set_non_modal().

I then call B.show().  B is now shown and brought to the top of the window stack.  That all seems good and proper.

However, it is now impossible for A to display in-front of B.  Even if I click on A, drag it around, whatever.  A is always placed behind B.

Is there a way to show() a window, bring it to the top, but not force it to stay on top no matter what?

Thanks,

Rob


imm

unread,
Jun 24, 2016, 2:03:51 PM6/24/16
to general fltk

The question might be what you think "non-modal" means here?

There are 3 window states; normal, modal and non-modal. Not 2 as might be assumed.

A non-modal window is always on top, like a modal window, but does not grab the focus (unlike a modal window.)

From the sound of things you probably want a normal window here.

--
Ian
From my Fairphone FP2
   

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob McDonald

unread,
Jun 24, 2016, 2:20:28 PM6/24/16
to fltk.general
I think my problem is along the lines of 'non-modal with respect to what?'

My program has another main window -- lets call it C.

I want my other windows (A,B) to be non-modal with respect to C, but normal with respect to each other.

It looks like the 'solution' is to 'show()' C immediately before B or A.  That way, it will be non-modal with respect to C...

Thanks,

Rob

Ian MacArthur

unread,
Jun 24, 2016, 4:45:42 PM6/24/16
to fltkg...@googlegroups.com
On Fri Jun 24 2016 19:20:28, Rob McDonald wrote:
I think my problem is along the lines of 'non-modal with respect to what?'

My program has another main window -- lets call it C.

I want my other windows (A,B) to be non-modal with respect to C, but normal with respect to each other.

It looks like the 'solution' is to 'show()' C immediately before B or A.  That way, it will be non-modal with respect to C...



Oh right; yes, that seems to be the way it works - a non-modal window tends to be non-modal for the window that is foreground when it (the non-modal window) is (first) shown.
At least, that’s what I found on OSX; I’m not sure if it’s a robust assumption, or how reliable it is across systems...



Greg Ercolano

unread,
Jun 24, 2016, 4:53:52 PM6/24/16
to fltkg...@googlegroups.com
The subject of how modal windows seems to come up a lot..
should we update the docs or add to the doxygen FAQ about this?

Reply all
Reply to author
Forward
0 new messages