> Stan wrote: > > Sorry, I wasn't clear enough. The window doesn't exit > > in response to the escape key or its 'x' button. > > Sounds like you want the window's callback. > > In that case use win.callback() instead of btn->callback(); > only the window's callback traps the 'x' and ESC. > And even then, you'll need to call hide() or exit() > from the callback to make the app exit. > > I prefer exit()/_exit() myself, since with hide() > you have to make sure you hide /all/ open windows, > not just the main window. (eg. file browsers, error dialogs..)
I seem to be having a great deal of trouble being articulate about this. I'm not having any trouble managing the lifetime of windows, nor do I have any particular reason to want to have a WHEN_CHANGED condition attached to a button. The brief program I posted was supposed to illustrate a situation that came up accidently, as the result of a coding error on my part. The point is this. Normally, in fltk, the esc key causes window exit, as does the 'x.' I can't see any reason that the sequence of events in the original post should change that behavior*. I was trying to find out if this odd side-effect is an artifact of my operating environment or is part of fltk. *In fact, I don't see why setting a button's "when" condition to FL_WHEN_CHANGED would be anything but a no-op. Does a button change? Cheers, Stan _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

