Calling take_focus on a widget before showing window segfaults on linux

5 views
Skip to first unread message

nj...@imap.cc

unread,
Feb 20, 2015, 1:24:28 PM2/20/15
to fltkg...@googlegroups.com
Changed button.cxx.
Added b3->take_focus();

Compiled in ubuntu 14.10 32 bits running in virtualbox.
Works in osx.

int main(int argc, char ** argv) {
Fl_Window *window = new Fl_Window(320,65);
Fl_Button *b1 = new Fl_Button(20, 20, 80, 25, "&Beep");
b1->callback(beepcb,0);
/*Fl_Button *b2 =*/ new Fl_Button(120,20, 80, 25, "&no op");
Fl_Button *b3 = new Fl_Button(220,20, 80, 25, "E&xit");
b3->callback(exitcb,0);
b3->take_focus();
window->end();
window->show(argc,argv);
#if 0
Fl::add_fd(0, stdin_cb);
#endif
return Fl::run();
}
Reply all
Reply to author
Forward
0 new messages