gui_sample.cpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:2k
- /*
- * ===========================================================================
- * PRODUCTION $Log: gui_sample.cpp,v $
- * PRODUCTION Revision 1000.1 2004/06/01 18:31:54 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.2
- * PRODUCTION
- * ===========================================================================
- */
- // generated by Fast Light User Interface Designer (fluid) version 1.0100
- #include <ncbi_pch.hpp>
- #include "gui_sample.hpp"
- static void sliderCB(Fl_Widget* o, void*) {
- printf("%g r", ((Fl_Counter*)o)->value());
- fflush(stdout);
- }
- static void closeWindowCB( Fl_Widget*, void* ) {
- delete mainWindow;
- }
- Fl_Window *mainWindow=(Fl_Window *)0;
- Fl_Menu_Item menu_[] = {
- {"&File", 0, 0, 0, 64, 0, 0, 14, 56},
- {"&Exit", 0, (Fl_Callback*)closeWindowCB, 0, 0, 0, 0, 14, 56},
- {0},
- {0}
- };
- int main(int argc, char **argv) {
- Fl_Window* w;
- { Fl_Window* o = mainWindow = new Fl_Window(361, 223, "GUI Sample");
- w = o;
- { Fl_Menu_Bar* o = new Fl_Menu_Bar(0, 0, 360, 25);
- o->menu(menu_);
- }
- { Fl_Button* o = new Fl_Button(125, 85, 180, 25, "Close");
- o->tooltip("Click to close the window");
- o->callback((Fl_Callback*)closeWindowCB);
- }
- { Fl_Counter* o = new Fl_Counter(125, 125, 180, 20, "Sample slider:");
- o->tooltip("Watch slider value in console");
- o->type(1);
- o->minimum(-100);
- o->maximum(100);
- o->step(1);
- o->callback((Fl_Callback*)sliderCB);
- o->align(FL_ALIGN_LEFT);
- }
- o->end();
- }
- w->show(argc, argv);
- return Fl::run();
- }