Hi there,

using the Java example of chapter 11.6 (Creating Dialogs at Runtime, p. 817ff) from the Developer Guide 2.0 (as of May 2005) for transcribing it into ooRexx I am stopped at where the Toolkit is used to create a peer supplying "null".

Here's the relevant transcription:

------------ cut here -----------
/*
   // create a peer
   Object toolkit = xMultiComponentFactory.createInstanceWithContext(
       "com.sun.star.awt.Toolkit", _xComponentContext);
   XToolkit xToolkit = (XToolkit)UnoRuntime.queryInterface(XToolkit.class, 
toolkit);
   XWindow xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, 
xControl);
   xWindow.setVisible(false);
   xControl.createPeer(xToolkit, null);
*/
   xToolkit  = 
xMultiComponentFactory~createInstanceWithContext("com.sun.star.awt.Toolkit", 
xContext)~XToolkit
   xWindow  = xControl~XWindow
   xWindow~setVisible(.false)
   xControl~createPeer(xToolkit, .nil)

------------ cut here -----------


All the transcribed statements work until the peer gets created, where createPeer() comes back with the following exception (intercepted in ooRexx and displayed in the terminal):

------------ cut here -----------
/// Java-exception (RexxAndJava) occurred:
[method invocation failed: java.lang.reflect.InvocationTargetException target 
exception: com.sun.star.uno.RuntimeException: createPeer: no model!]
\\\
------------ cut here -----------

So it seems that running the program from the command-line does not work by supplying "null" as an argument in the createPeer() method. Some "model" object is missing.

This is actually what I would like to achieve: create a dialog at runtime to have something like Basics MsgBox available, if ooRexx scripts are executed via the OOo scripting framework. What would be necessary to get createPeer() up and running in this context?

Any hints highly appreciated.

---rony


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

Reply via email to