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.
The parent is the one you gave to the toolkit when the dialog is constructed. In your case it is obviously "None". So it's not surprising that you don't find a parent. :-) > 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. In case you have one dialog for all macros you want to use you should consider something like a global variable. That works in Basic, don't know about Python. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
