Romain Behar wrote:
> Hello,
> I'm writing an application (using latest FLTK 2 snapshots), and began adding 
> custom dialog windows. It contains a GlWindow object that opens a custom 
> dialog on right click event. Such custom dialog opens properly when called 
> through a menu item, but hangs in Window.exec() function when called right 
> after calling the file_chooser dialog. This happens when loading a file and 
> right clicking in the GL view (calling the same dialog from a menu item never 
> hangs).
> 
> The code below shows the bug, opening the 'Dialog' item from the File menu 
> works properly, while calling the 'Open' one (click either OK or Cancel) 
> hangs the window.
> 
> The my_dialog function is called right after fltk::file_chooser() in 
> on_menu_file_open(), there might be something to do in between to prevent the 
> bug. Tested on one platform only : Ubuntu 7 (i386).
> 
>  Thanks for any help,
> 
>   Romain

Hi,

I would advise using this:

static int my_dialog()
{
    // build dialog window
    fltk::Window window(400, 200, "Properties"); <--
    window.begin();
    // ...
    window.end();

        window.exec();

    return 0;
}

Parameter you added made call to totally another window implementation,
targeted for childs. Window hanged presumably because non-existent group
tried to add that window as it's child. Always use Window(width, height, label)
constructor for plain windows :)

--
Sanel
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to