MoI discussion forum
MoI discussion forum

Full Version: API issues moving windows

Show messages: All  1-9  10-11

From: Michael Gibson
23 Jan 2023   [#10] In reply to [#9]
Hi Joe,

re:
> I can get `resize()` to work but not `move()`...

Is it possible that the coordinates you are giving to move() are not at a visible point on the desktop window? Maybe the y coordinate in particular is underneath the Mac top menu bar.

What happens if you try running this version:

code:
var dlg = moi.ui.createDialog( '<html><body class="DialogBody"><div>testing...</div><moi:DialogClose/></body></html>', 'resizable,defaultWidth:350,defaultHeight:200' );

while ( dlg.waitForEvent() ){
    if ( dlg.event == "display" )
        break;
}

dlg.window.move( 100, 100 );

> In this example, `isModal ` means that it blocks interaction with MoI until it is dismissed (Qt::ApplicationModal).

You can do a modal dialog by calling dialog.window.doModal(); after moi.ui.createDialog(). That will call setWindowModality( Qt::WindowModal );


> Style control the layout and window type like Qt::Window, Qt::Dialog, Qt::Tool, Qt::Popup, etc. Allowing
> the FramelessWindowHint would be cool to do HUDs and overlays.

You can use var menu = moi.ui.showMenu() to create a Qt::Popup window with FramelessWindowHint instead of a dialog.

The options you can currently set for a dialog are:
resizable, fixedWidth, fixedHeight, defaultWidth, defaultHeight, and noCloseButton.

- Michael
From: Joe (CTKJOSE)
24 Jan 2023   [#11] In reply to [#10]
@Michael

Thanks for directing me in the right direction. My values were always positive, but kept trying and figure out the issue is MacOS's Menu Bar.

I have to keep my "Y" above 24pt (in Big Sur and above).

Show messages: All  1-9  10-11