On 11/07/11 16:41, David wrote:
> What's the best way to get the top most open window that has keyboard focus?
In short, I'm thinking: Fl::focus()->window()
Fl::focus() returns the current Fl_Widget with focus (if any),
and Fl_Widget::window() returns the parent window.
Note both Fl::focus() and window() can return NULL,
so check return values first.
> Also what order is Fl::first_window() in?
> Z-Order (top most first or bottom most first)
> or created order?
I don't know this one, so I'd refer to the docs:
http://fltk.org/doc-1.3/group__fl__windows.html#ga3130407bc1c11f9b7f2a9c43a87a1599
"Returns the first top-level window in the list of shown() windows.
If a modal() window is shown this is the top-most modal window,
otherwise it is the most recent window to get an event."
If it doesn't make sense, try some empirical tests to see.
On some systems, a window can be below others in Z, yet can
have focus and receive events (eg. window managers with
focus-follows-mouse enabled)
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk