How can i set DesktopAsParent for a dialog in a library?

I would like the dialog to run in a process separate from LO not just for the ability to interact with either as needed but also because a modal dialog dims the sheets, making them stand out less to the eye.

I imagine its a good bit more complicated than what I have so far:

sub appmain

    dim mainlib as object, maindlg as object

    rem container for mainlib is same document where this code lives

    mainlib = dialoglibraries.getbyname("mainlib")
	maindlg = createunodialog(mainlib.getbyname("thedialog"))

    rem obey certain visual properties set in dialog designer
    maindlg.getpeer().setproperty("NativeWidgetLook", false)

end sub

I have used the desktop property before on a dialog that was created in running code but i dont know how to adopt that to this situation.


As you have noted, with a runtime dialog it is setting the desktop as parent. This is not (not to my finding anyway) how to do this with graphically created dialog. This is done using setVisible and a loop.

Here is a link to my answer with links (eventually) to each method → Calc BASIC: How to popup a dialog ?

Here is the direct link to what you are looking for → How to make non-modal dialog?

Looking back through your past questions, had already given you this information here → how to compose dialog invisibly?

okay, that TopListen code seems to be exactly what i need. I keep forgetting that controls can respond to events without executing the dialog. Ehhhxcellent, thank you.