// @topic W010101 FLTK Graphics -- window, output box, button // @brief Button callback, text box update #include <FL/Fl.H> #include <FL/Fl_Double_Window.H> #include <FL/Fl_Output.H> #include <FL/Fl_Button.H> void cb_btn_animate( Fl_Widget* btn, void* userdata ); int main() { Fl_Double_Window window = Fl_Double_Window( 283, 110 ); Fl_Output output = Fl_Output( 30, 15, 100, 25 ); Fl_Button button = Fl_Button( 40, 60, 75, 25, "Animate" ); button.callback( ( Fl_Callback* ) cb_btn_animate, &output ); window.end(); window.resizable( window ); window.show(); return Fl::run(); } void cb_btn_animate( Fl_Widget* btn, void* userdata ) { Fl_Output& output = *static_cast< Fl_Output* >( userdata ); output.value( "Hello" ); }