Problems about creating TreeCtrol on openoffice popup dialog by pyuno

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems about creating TreeCtrol on openoffice popup dialog by pyuno

dongtao
Hi,

there are java codes to control the elements of a dialog created by
OOBasic dialog editor. But the python codes translated from the java
codes do not work.

the java codes are listed below:

Reference< XDialog > xDialog=xDialog2->createDialogWithHandler(
                OUString::createFromAscii( "vnd.sun.star.script:Standard.SimpleTreeDialog?location=application" ),
                (XCountable *)this);

the corresponding python codes:

        dongtao1=self.smgr.createInstanceWithArgumentsAndContext("com.sun.star.awt.DialogProvider",
                (self.desktop.getCurrentComponent(),),self.ctx)
        dialog=dongtao1.createDialog("vnd.sun.star.script:Standard.SimpleTreeDialog?location=application")
        dialog.execute()

SimpleTreeDialog is created by OOBasic Editor. The above python codes
are stuck at dialog=dongtao1.createDialog(...).

Thanks for advance.

the whole java codes are located at
http://wiki.services.openoffice.org/wiki/Going_further_with_Dialog_and_Component#Multi-Page_Dialog


Best regards,
nuix


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problems about creating TreeCtrol on openoffice popup dialog by pyuno

Joerg Budischewski
Hi,

you need to implement the XCountable interface as an uno object (see
http://udk.openoffice.org/python/python-bridge.html#objects) and pass an
instance of it as 2nd argument to createDialogWithHandler() call.

Your code will fail, because you just pass a string where a string and a
 XCountable uno object is expected.

Bye,

Joerg

dongtao schrieb:

> Hi,
>
> there are java codes to control the elements of a dialog created by
> OOBasic dialog editor. But the python codes translated from the java
> codes do not work.
>
> the java codes are listed below:
>
> Reference< XDialog > xDialog=xDialog2->createDialogWithHandler(
>                 OUString::createFromAscii( "vnd.sun.star.script:Standard.SimpleTreeDialog?location=application" ),
>                 (XCountable *)this);
>
> the corresponding python codes:
>
>         dongtao1=self.smgr.createInstanceWithArgumentsAndContext("com.sun.star.awt.DialogProvider",
>                 (self.desktop.getCurrentComponent(),),self.ctx)
>         dialog=dongtao1.createDialog("vnd.sun.star.script:Standard.SimpleTreeDialog?location=application")
>         dialog.execute()
>
> SimpleTreeDialog is created by OOBasic Editor. The above python codes
> are stuck at dialog=dongtao1.createDialog(...).
>
> Thanks for advance.
>
> the whole java codes are located at
> http://wiki.services.openoffice.org/wiki/Going_further_with_Dialog_and_Component#Multi-Page_Dialog
>
>
> Best regards,
> nuix
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]