FLTK logo

[master] 8d26d5e - Hide window in quit callback in wizard-simple example

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 8d26d5e - Hide window in quit callback in wizard-simple example "Albrecht Schlosser" Mar 20, 2021  
 
commit 8d26d5ed4bca7e1a8c448f334a4e24caf08b38e9
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Sun Mar 21 02:10:19 2021 +0100
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Sun Mar 21 02:10:19 2021 +0100

    Hide window in quit callback in wizard-simple example

 examples/wizard-simple.cxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git examples/wizard-simple.cxx examples/wizard-simple.cxx
index f434bc9..fd7d9e5 100644
--- examples/wizard-simple.cxx
+++ examples/wizard-simple.cxx
@@ -3,7 +3,7 @@
 //      Originally from erco's cheat sheet 06/05/2010, permission by author.
 //
 // Copyright 2010 Greg Ercolano.
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2021 by Bill Spitzak and others.
 //
 // This library is free software. Distribution and use rights are outlined in
 // the file "COPYING" which should have been included with this file.  If this
@@ -15,7 +15,7 @@
 //
 //     https://www.fltk.org/bugs.php
 //
-#include <stdlib.h>
+
 #include <FL/Fl.H>
 #include <FL/Fl_Window.H>
 #include <FL/Fl_Group.H>
@@ -30,7 +30,7 @@ Fl_Wizard *G_wiz = 0;
 
 void back_cb(Fl_Widget*,void*) { G_wiz->prev(); }
 void next_cb(Fl_Widget*,void*) { G_wiz->next(); }
-void done_cb(Fl_Widget*,void*) { exit(0); }
+void done_cb(Fl_Widget*w,void*) { w->window()->hide(); }
 
 int main(int argc, char **argv) {
     G_win = new Fl_Window(400,300,"Example Wizard");
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.