FLTK logo

[fltk.general] Re: Is it possible to run a direct command in Callback?

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.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Is it possible to run a direct command in Callback? "lifeatt... Jan 25, 2022  
  Might try using a lambda [I've not tried it ...]  Will require C++11.

BtExit->callback( [](Fl_Widget *, void *) { exit(0); } );

Is it possible for me to run the command exit(0); without using a function, right in this callback command? How do I do that? for example:
BtExit->callback(exit(0));
 

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/7f158db6-3454-4cc9-b552-424393b99147n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]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'.