fltk

create custom fltk dialog / modal window

人走茶凉 提交于 2020-01-06 18:44:45
问题 I want to create a custom dialog window with fltk. I will put the widgets. Background process should wait to the dialog's finish. I couldn't find any example for this. I am looking fl_input function. I found makeform() function but it didn't help very much. 回答1: I found innate() function in the library. In the function there is a line following: while (w->shown()) Fl::wait(); this is my solution. For example: Fl_Window* w = new Fl_Window(400, 300); w->set_modal(); w->show(); while (w->shown()

create custom fltk dialog / modal window

会有一股神秘感。 提交于 2020-01-06 18:44:31
问题 I want to create a custom dialog window with fltk. I will put the widgets. Background process should wait to the dialog's finish. I couldn't find any example for this. I am looking fl_input function. I found makeform() function but it didn't help very much. 回答1: I found innate() function in the library. In the function there is a line following: while (w->shown()) Fl::wait(); this is my solution. For example: Fl_Window* w = new Fl_Window(400, 300); w->set_modal(); w->show(); while (w->shown()

how to change the background color of Fl_Window by pressing Fl_Button

送分小仙女□ 提交于 2019-12-25 00:37:57
问题 Can anyone tell me, how to change the background color of Fl_Window by pressing Fl_Button. I'm trying to do it this way but it's not working. void new_color(Fl_Widget* w, void*){ Fl_Button* b = (Fl_Button*)w; b->parent()->color(FL_RED); } int main() } Fl_Window* win = new Fl_Window(...); win->color(FL_WHITE); win->begin(); Fl_Button* but = new Fl_Button(...); but->callback(new_color); win->end(); ... } thanks!!! 回答1: As pointed by cup, redraw does the trick: #include <FL/Fl.H> #include <FL/Fl

Setup Xcode and FLTK

偶尔善良 提交于 2019-12-20 15:34:33
问题 Errors I get when trying to build the first block of code on this page under Xcode Undefined symbols for architecture x86_64: "fl_define_FL_SHADOW_LABEL()", referenced from: _main in main.o I installed FLTK with homebrew by brew install FLTK and there were no errors: /usr/local/Cellar/fltk/1.3.2_1: 315 files, 5.8M, built in 93 seconds I realize this problem has been asked before, but the answer You need to install it first as it's not on Mac OS X, using something like homebrew/macports

Setup Xcode and FLTK

房东的猫 提交于 2019-12-20 15:34:08
问题 Errors I get when trying to build the first block of code on this page under Xcode Undefined symbols for architecture x86_64: "fl_define_FL_SHADOW_LABEL()", referenced from: _main in main.o I installed FLTK with homebrew by brew install FLTK and there were no errors: /usr/local/Cellar/fltk/1.3.2_1: 315 files, 5.8M, built in 93 seconds I realize this problem has been asked before, but the answer You need to install it first as it's not on Mac OS X, using something like homebrew/macports

FLTK in MSVC needs x11 headers?

那年仲夏 提交于 2019-12-19 07:48:29
问题 I'm trying to learn how to use FLTK right now (In MSVC 2008). I got all the the libraries compiled correctly, but when I tried to run this program: #include "FL/Fl.H" #include "FL/Fl_Window.H" #include "FL/Fl_Box.H" int main(int argc, char *argv[]) { Fl_Window *window = new Fl_Window(340, 180); Fl_Box *box = new Fl_Box(20, 40, 300, 100, "Hello, World!"); box->box(FL_UP_BOX); box->labelfont(FL_BOLD + FL_ITALIC); box->labelsize(36); box->labeltype(FL_SHADOW_LABEL); window->end(); window->show()

Not able to make fltk on Mingw

醉酒当歌 提交于 2019-12-13 19:12:12
问题 I am trying to install fltk in Mingw-32 bit on Windows10. I download fltk-1.3.5 from here, unzipped it, cd to folder and run command make to build it. But it gives me following error: $ make === making jpeg === === making zlib === === making png === === making src === === making fluid === Compiling ExternalCodeEditor_WIN32.cxx... ExternalCodeEditor_WIN32.cxx: In function ‘const char* get_ms_errmsg()’: ExternalCodeEditor_WIN32.cxx:37:5: error: ‘_snprintf’ was not declared in this scope; did

FLTK SIGSEGV Segmentation Fault when calling fl_line()

此生再无相见时 提交于 2019-12-13 07:58:48
问题 Calling fl_line() in my program immediately returns an SIGSEGV exception after drawing 1 line on the screen. I've checked vectors offset, nothing out of bounds: Here's how it looks like when it crashes Here's the call stack Why is fl_line() called with parameters but not Fl_graphics_driver::line() ? Here's my program, it was to draw a simple polygon out of 4 points: #include <iostream> #include <FL/Fl.H> #include <FL/Fl_draw.H> #include <FL/Fl_Window.H> #include <FL/Fl_Widget.H> #include

FLTK simple animation

好久不见. 提交于 2019-12-12 19:09:21
问题 I can successfully compiled and run the Hello World code. Now I want to do something like animation. I first create a rectangle class to implement draw() from Fl::widget class myRect: public Fl_Widget { private: Fl_Color color; void draw(){ fl_color(color); fl_rectf(x(),y(),w(),h(),color); } public: myRect(int X,int Y,int W,int H, Fl_Color c) : Fl_Widget(X,Y,W,H),color(c) {} }; int main (int argc, char ** argv) { Fl_Window *window = new Fl_Window (300, 180, "FLTK Test"); vector<myRect*>

FLTK in xCode math.h error

六月ゝ 毕业季﹏ 提交于 2019-12-12 06:51:10
问题 I have been trying to set up FLTK in xCode. After a little struggling I thought I was successful in linking all the libraries, etc... However, I am now getting the following error from the math.h file located in the FL/include folder: '/usr/include/math.h'file not found from the following code: // Xcode on OS X includes files by recursing down into directories. // This code catches the cycle and directly includes the required file. #ifdef fl_math_h_cyclic_include # include "/usr/include/math