> On 15/01/11 21:57, Percy wrote:
> > This is a little hard to explain, but I'll give it a go:
> >
> > I have 3 windows, two that are modal inside eachother, like this:
> > Window ->  ModalWindow1 ->  ModalWindow2
> >
> > Everything works fine, but when I hide() ModalWindow2 and
> > ModalWindow1 (so that only Window is left), Window seems to go into
> > the background. What I mean by the "background" is that any other
> > applications that are currently open behind it, are brought to the
> > front. I haven't put in any code to do this, so I'm wondering why
> > this happens and if there's a solution around it.
> >
> > I hope I explained it alright. Also, I'm using fltk-1.3.x-r7677
> > (win7)
>
> Without seeing more of your code, I'd have to guess that there's some
> sort of issue with the way the modality is being set... Maybe...
> It certainly should not do what you are describing.
>
> Is it possible for you to make a small, self-contained, compileable
> example that exhibits the behaviour and sets up the same window
> relationships you use in your code? Then we could play about with it and
> see what is happening.
>
> Also, note that r7677 is a bit dated now (current as I type is r8278) so
> there may be some use in updating to a current build, just in case...

Here is an example that replicates the problem:

#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <windows.h>

void CBshow( Fl_Widget*, void* d )
{
        ( (Fl_Window*)d )->show();
}

void CBhide( Fl_Widget*, void* d )
{
        ( (Fl_Window*)d )->hide();
}

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR 
lpCmdLine, int nCmdShow )
{
        Fl_Window* ModalTwo = new Fl_Window( 200, 100, "ModalTwo" );
        {
                Fl_Button* ButtonHide = new Fl_Button( 100, 0, 100, 100, "Hide" 
);
                ButtonHide->callback( CBhide, ModalTwo );
        }
        ModalTwo->set_modal();
        ModalTwo->end();

        Fl_Window* ModalOne = new Fl_Window( 200, 100, "ModalOne" );
        {
                Fl_Button* ButtonShow = new Fl_Button( 0, 0, 100, 100, "Show" );
                ButtonShow->callback( CBshow, ModalTwo );
                Fl_Button* ButtonHide = new Fl_Button( 100, 0, 100, 100, "Hide" 
);
                ButtonHide->callback( CBhide, ModalOne );
        }
        ModalOne->set_modal();
        ModalOne->end();

        Fl_Window* Window = new Fl_Window( 200, 100, "Window" );
        {
                Fl_Button* ButtonShow = new Fl_Button( 0, 0, 100, 100, "Show" );
                ButtonShow->callback( CBshow, ModalOne );
        }
        Window->end();

        Window->show();

        Fl::run();
}

This problem doesn't happen when you disable the ->set_modal() lines.
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to