mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 00:22:42 +08:00
Fl::delete_widget() now hides a widget/window if it is shown (visible_r()).
This is useful (necessary) because in old (pre 1.1.6) which didn't have Fl::delete_widget() users would have called 'delete window', which would have hidden a window and destroyed it as well. Now the widget/window is hidden immediately, whereas it is destroyed delayed, which comes much closer to the previous behavior and is useful for better window close detection in Mac OS X cmd-Q handling. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10456 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -2,15 +2,17 @@ CHANGES IN FLTK 1.3.4 RELEASED: ??? ?? ????
|
|||||||
|
|
||||||
New features and extensions
|
New features and extensions
|
||||||
|
|
||||||
- added full support of true subwindows to the Mac OS X FLTK platform. Window
|
- added full support of true subwindows to the Mac OS X FLTK platform.
|
||||||
nesting to any depth is possible. An Fl_Gl_Window window or subwindow
|
Window nesting to any depth is possible. An Fl_Gl_Window window or
|
||||||
can contain Fl_Window's as subwindows.
|
subwindow can contain Fl_Window's as subwindows.
|
||||||
|
|
||||||
Other improvements
|
Other improvements
|
||||||
|
|
||||||
- fl_read_image() now captures all pixels within the rectangle described
|
- fl_read_image() now captures all pixels within the rectangle
|
||||||
by its arguments, whether they belong to a GL scene or not (STR #3142). It also
|
described by its arguments, whether they belong to a GL scene
|
||||||
captures subwindows of GL windows.
|
or not (STR #3142). It also captures subwindows of GL windows.
|
||||||
|
- Fl::delete_widget() now hides the widget or window immediately
|
||||||
|
(i.e. when called) - only destruction is delayed as before.
|
||||||
|
|
||||||
CHANGES IN FLTK 1.3.3 RELEASED: Nov 03 2014
|
CHANGES IN FLTK 1.3.3 RELEASED: Nov 03 2014
|
||||||
|
|
||||||
|
|||||||
+12
-3
@@ -1865,7 +1865,13 @@ static Fl_Widget **dwidgets = 0;
|
|||||||
When deleting groups or windows, you must only delete the group or
|
When deleting groups or windows, you must only delete the group or
|
||||||
window widget and not the individual child widgets.
|
window widget and not the individual child widgets.
|
||||||
|
|
||||||
\since FLTK 1.3 it is not necessary to remove widgets from their parent
|
\since FLTK 1.3.4 the widget will be hidden immediately, but the actual
|
||||||
|
destruction will be delayed until the event loop is finished. Up to
|
||||||
|
FLTK 1.3.3 windows wouldn't be hidden before the event loop was done,
|
||||||
|
hence you had to hide() a window in your window close callback if
|
||||||
|
you called Fl::delete_widget() to destroy (and hide) the window.
|
||||||
|
|
||||||
|
\since FLTK 1.3.0 it is not necessary to remove widgets from their parent
|
||||||
groups or windows before calling this, because it will be done in the
|
groups or windows before calling this, because it will be done in the
|
||||||
widget's destructor, but it is not a failure to do this nevertheless.
|
widget's destructor, but it is not a failure to do this nevertheless.
|
||||||
|
|
||||||
@@ -1876,8 +1882,11 @@ static Fl_Widget **dwidgets = 0;
|
|||||||
*/
|
*/
|
||||||
void Fl::delete_widget(Fl_Widget *wi) {
|
void Fl::delete_widget(Fl_Widget *wi) {
|
||||||
if (!wi) return;
|
if (!wi) return;
|
||||||
|
|
||||||
// don;t add the same widget twice
|
// if the widget is shown(), hide() it (FLTK 1.3.4)
|
||||||
|
if (wi->visible_r()) wi->hide();
|
||||||
|
|
||||||
|
// don't add the same widget twice to the widget delete list
|
||||||
for (int i = 0; i < num_dwidgets; i++) {
|
for (int i = 0; i < num_dwidgets; i++) {
|
||||||
if (dwidgets[i]==wi) return;
|
if (dwidgets[i]==wi) return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user