diff options
| author | Ian MacArthur <imacarthur@gmail.com> | 2014-10-29 14:21:08 +0000 |
|---|---|---|
| committer | Ian MacArthur <imacarthur@gmail.com> | 2014-10-29 14:21:08 +0000 |
| commit | 11ef7ee9e6b3c39a7052f896da96369dc098d8ae (patch) | |
| tree | 9e7f91bab747ae39a3c38b9d0e14573d055f8a39 /FL/Fl_Window.H | |
| parent | be19d2c3d60a4647143694debfc7ba295fa1ab3c (diff) | |
Add method Fl_Window::clear_modal_states(),
addresses STR #3123
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10404 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Window.H')
| -rw-r--r-- | FL/Fl_Window.H | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H index f42bf2598..6f7693ffb 100644 --- a/FL/Fl_Window.H +++ b/FL/Fl_Window.H @@ -300,6 +300,45 @@ public: unsigned int non_modal() const {return flags() & (NON_MODAL|MODAL);} /** + Clears the "modal" flags and converts a "modal" or "non-modal" + window back into a "normal" window. + + Note that there are <I>three</I> states for a window: modal, + non-modal, and normal. + + You can not change the "modality" of a window whilst + it is shown, so it is necessary to first hide() the window, + change its "modality" as required, then re-show the window + for the new state to take effect. + + This method can also be used to change a "modal" window into a + "non-modal" one. On several supported platforms, the "modal" state + over-rides the "non-modal" state, so the "modal" state must be + cleared before the window can be set into the "non-modal" + state. + In general, the following sequence should work: + + \code + win->hide(); + win->clear_modal_states(); + //Set win to new state as desired, or leave "normal", e.g... + win->set_non_modal(); + win->show(); + \endcode + + \note Under some window managers, the sequence of hiding the + window and changing its modality will often cause it to be + re-displayed at a different position when it is subsequently + shown. This is an irritating feature but appears to be + unavoidable at present. + As a result we would advise to use this method only when + absolutely necessary. + + \see void set_modal(), void set_non_modal() + */ + void clear_modal_states() {clear_flag(NON_MODAL | MODAL);} + + /** Marks the window as a menu window. This is intended for internal use, but it can also be used if you |
