[Gambas-user] Embed xfce4 panel into gambas application

Doriano Blengino doriano.blengino at ...1909...
Thu Aug 21 22:11:30 CEST 2008


M0E Lnx ha scritto:
> Attn Beniot... Please help
>
> Can you explain how to use the WM_CLASS string to embed an application
> using the embedder object?
>   
I did not try this in gambas, but I read the docs. The Desktop.find() 
method takes "regular expression" parameters, so if you search for a 
window class, and you do not know the other strings, you should specify 
them using a pattern:

  hPointer = Desktop.Find(".*", "Gpartedbin", ".*")

I am not sure if empty strings ("") work, so you should try with ".*" 
which matches any string.

What you receive is an array of all the windows matching your request, 
so you can try also:

  hPointer = Desktop.Find(".*", "partedbi", ".*")

(note that "partedbi", as regular expression, should match "Gpartedbin", 
"gpartedbin", and so on...

Then you can analyze hPointer.count to see if a meaningful result is 
returned. If .count is 1, then you are done; hPointer[0] is the value 
you need to embed.

I opened a shell, and typed:

    xprop |grep WM_CLASS

then clicked in a firefox window, and got:

    WM_CLASS(STRING) = "firefox-bin", "Firefox-bin"

I don't know why there are two strings (class and instance?), but 
passing "irefox-bin" to Desktop.Find() should work.

Hope this is useful - cheers.

Doriano Blengino





More information about the User mailing list