Zbigniew Banach wrote:
Hi folks,

I'm working on an application basically made up of a number of OOo
macros (in Python) and I've run into problems working with dialogs. What
I'm trying to do is have a non-modal dialog that will be permanently
displayed to the user to show application-related information that is
updated as macros are executed on text within a Writer document.

Now the problem. I want subsequent macro calls to access the same dialog
(which is open all the time) and I can't find a way to get access the
open dialog control from a freshly-called macro. Basically, I create the
dialog once using a macro containing something like:

ctx = uno.getComponentContext()
smgr = ctx.ServiceManager
dialogModel = smgr.createInstanceWithContext(
    "com.sun.star.awt.UnoControlDialogModel", ctx)
## snip
toolkit = smgr.createInstanceWithContext(
    "com.sun.star.awt.Toolkit", ctx)
controlContainer.createPeer(toolkit, None)
controlContainer.setVisible(True)

and once this macro has finished, I want to access the same
UnoControlDialogModel from subsequent macros. I've tried through Desktop
frames and components, but the dialog doesn't seem to have a parent that
I can access.

It seems to me that either I'm missing something fundamental about
window/frame hierarchies or OOo dialogs simply don't work the way I'm
trying to use them (and I should look into forms to do what I need). How
can I access an open dialog window from a macro? Any help would be
greatly appreciated.
FRom wath i understood from Dialogs: they are run on top off the current application ( say a open writerdioc) and you can only go back to the application after the Dialog has been closed. You can use a dialog as a "information container" as long that your macro's are run from buttoms present in your Dialog or eventlisteners attached to your Dialog or other ellenents in your running application. You can run different dialog's one on top of a other (look at the code off the exellent xray-tool for this behavior) hope it helps a bit
Cheers,

Zbigniew Banach

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to