[Gambas-user] embed OpenOffice

Benoit Minisini gambas at ...1...
Sat Oct 11 20:49:09 CEST 2008


On samedi 11 octobre 2008, Doriano Blengino wrote:
> jbskaggs ha scritto:
> > I have looked at the embedder example. I have looked at every post on
> > this forum on finding the title of the new window.
> >
> > I cannot figure it out and get it to work.
> >
> > Could somebody have pity and show me how to get the title of the window
> > when I shell to Openoffice and how to give it to the embedder?
> >
> > JB
>
> You can use xwininfo to look at window information. "xlsclients -al"
> shows many informations about windows.
>
> On my PC I did this test after launching openoffice:
>
> doriano at ...1993...:/root$ xlsclients -la
> Window 0x1c00005:
>   Machine:  doripc
>   Name:  mrxvt
>   Icon Name:  mrxvt
>   Command:  mrxvt -xft -xftfm FreeMono -xftsz 11 -vb -geometry 90x30
>   Instance/Class:  mrxvt/XTerm
> Window 0x120000a:
>   Machine:  doripc
>   Name:  kicker
>   Command:  kicker
>   Instance/Class:  kicker/Kicker
> Window 0x400001:
>   Machine:  doripc
>   Name:  Mozilla-Thunderbird
>   Icon Name:  icedove-bin
>   Command:  icedove-bin
>   Instance/Class:  icedove-bin/Icedove-bin
> Window 0x1a00001:
> ''  Command:  /bin/sh /usr/lib/openoffice/program/soffice
>
>
> Now I see that the window 0x1a00001 is the window I am interested in, so
> I issue:
>
> doripc:~# xprop -id  0x1a00001
> WM_COMMAND(STRING) = { "/bin/sh", "/usr/lib/openoffice/program/soffice" }
> WM_CLIENT_LEADER(WINDOW): window id # 0x1a00001
> _KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 3979416247
>
> ...just to discover that that window seems not to have a name...
>
> So, while a common method to find a window was Desktop.find() (look at
> previous messages in this list), this time may be that doesn't work.
> Perhaps you can 'SHELL "xlsclients -la" TO sXls', and then parse sXls to
> find out the window ID. Desktop.Find() can be used to get all the windows,
> but then don't know how to get more information. One way could be to
> execute a find, then launch openoffice, then do a find again to see what
> window has been added...
>
> Hope this could help.
>
> Doriano.
>
>

You have to look at the "window class":

$ xprop
<click on the OpenOffice window>
...
WM_CLASS(STRING) = "VCLSalFrame.DocumentWindow", "OpenOffice.org 2.4"
...

Desktop.Find can look for a specific window class with its second argument. I 
don't know if it works in that case, because apparently the OpenOffice window 
has two classes!

Regards,

-- 
Benoit Minisini




More information about the User mailing list