[Gambas-user] embed OpenOffice
jbskaggs
jbskaggs at ...1871...
Tue Oct 14 01:32:45 CEST 2008
I can get Abiword to embed. Openoffice is still giving me a fit. I got it
to embed once but could not duplicate it. Is it possible that OpenOffice
specifically did their window names like this to keep people from embedding
it? Or at least difficult.
I have tried searching by both window classes
by the strings open, office, text, etc
by the window id
All I ever get is a out of bounds error
here is my code: (which works great with Abiword)
PUBLIC SUB Presence_Embed(windowTitle AS String)
DIM key AS Pointer[]
DIM i AS Integer
WAIT 3.0
key = Desktop.Find(windowTitle)
i = key[0]
Embedder1.Embed(i)
Embedder1.SetFocus
Embedder1.Visible = TRUE
END
PUBLIC SUB Form_Open()
DIM iWindowInfoArray AS Integer
SHELL "ooffice -writer " & Quote.Shell(FChandScn.htmlpath)
Presence_Embed("text") <<<<<<<<<<<<<<<<<<<<<<<<<< this is where I tried
the various strings to search by
END
Thanks
JB
Benoit Minisini wrote:
>
> 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
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
--
View this message in context: http://www.nabble.com/embed-OpenOffice-tp19929257p19964766.html
Sent from the gambas-user mailing list archive at Nabble.com.
More information about the User
mailing list