Hiding a Window view

About Monkey 2 Forums Monkey 2 Programming Help Hiding a Window view

This topic contains 4 replies, has 3 voices, and was last updated by  nerobot 1 year, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12258

    Hezkore
    Participant

    I’m trying to hide a Window view.
    It starts out hidden using ‘WindowFlags.Hidden’ and I’m using ‘myWindow.Visible=True’ to show it.
    But when I try to hide it with ‘myWindow.Visible=False’ I get the debug message “Windows cannot be deactivated”
    It’s not my main window, I have a separate window that is always open.

    Mistake, or am I doing something wrong?

    Also, is there a way to make a “tool” window?

    #12267

    Mark Sibly
    Keymaster

    Monkey2 only currently supports a single window. Multiple windows may or may not work to varying degrees depending on target – they are totally untested. By all means feel free to get in there and try to get them working – the basic framework is there –  but I wont be able to address this myself for a while yet.

    #12287

    Hezkore
    Participant

    Ah okay, I hadn’t even thought about it working on other targets…

    I’ve been poking about, trying to figure it out myself, atleast on desktop targets since that’s all I need.
    But I’m not quite getting the results I want.

    Here’s a simple example if anyone’s interested:

    Wait for the small window to appear, then try to close it (which should just hide it)
    Hidden windows do work if they’re created with ‘WindowFlags.Hidden’, but showing them and then hiding them manually causes the error “Windows cannot be deactivated”

    #12288

    Hezkore
    Participant

    sdl2.SDL_HideWindow( Self.SDLWindow ) and sdl2.SDL_ShowWindow( Self.SDLWindow ) seems to do the trick.
    Things get a bit weird at places, and you may need to redraw the window when shown… but overall it works.

    #12297

    nerobot
    Participant

    And… we can use real windows for showing dialogs, and for hints to be able to go beyond the boundaries of main window. 🙂

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.