Re: [fltk.general] Calling take_focus on a widget before showing windowsegfaults on linux

3 views
Skip to first unread message

Albrecht Schlosser

unread,
Feb 20, 2015, 1:49:43 PM2/20/15
to fltkg...@googlegroups.com
On 20.02.2015 19:24 nj...@imap.cc wrote:
> Changed button.cxx.
> Added b3->take_focus();
>
> Compiled in ubuntu 14.10 32 bits running in virtualbox.
> Works in osx.

Which FLTK version? If it is not 1.3.3, please upgrade. If it is 1.3.3,
could you please try current svn or a recent snapshot?

> 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();
> }

This works well for me (Ubuntu 14.04 in Virtualbox VM) and shows the
intended effect ("Exit" button has focus).

Albrecht Schlosser

unread,
Feb 20, 2015, 1:52:05 PM2/20/15
to fltkg...@googlegroups.com
On 20.02.2015 19:49 Albrecht Schlosser wrote:
> On 20.02.2015 19:24 nj...@imap.cc wrote:
>> Changed button.cxx.
>> Added b3->take_focus();
>>
>> Compiled in ubuntu 14.10 32 bits running in virtualbox.
>> Works in osx.
>
> Which FLTK version? If it is not 1.3.3, please upgrade. If it is 1.3.3,
> could you please try current svn or a recent snapshot?

...

> This works well for me (Ubuntu 14.04 in Virtualbox VM) and shows the
> intended effect ("Exit" button has focus).

I forgot to mention: my version is 64-bit though.

nj...@imap.cc

unread,
Feb 20, 2015, 2:21:48 PM2/20/15
to fltkg...@googlegroups.com

On Fri, Feb 20, 2015, at 19:51, Albrecht Schlosser wrote:
> On 20.02.2015 19:49 Albrecht Schlosser wrote:
> > On 20.02.2015 19:24 nj...@imap.cc wrote:
> >> Changed button.cxx.
> >> Added b3->take_focus();
> >>
> >> Compiled in ubuntu 14.10 32 bits running in virtualbox.
> >> Works in osx.
> >
> > Which FLTK version? If it is not 1.3.3, please upgrade. If it is 1.3.3,
> > could you please try current svn or a recent snapshot?

Ok solved.
Crashes in 1.3.3.
Works ok in 1.3.3:10586.
Reply all
Reply to author
Forward
0 new messages