[Gambas-user] New to Gambas - coding question how to find the active window on an Ubuntu 7.10 desktop

Khos kim.hoskin at ...1073...
Sun Jan 20 21:40:25 CET 2008


Hi,

So from what I can gather it might not be possible with desktop.find() to
get the active window info (could a component be developed:)) but does this
xwininfo or man xwininfo give you info of the window that your mouse is
hovering over? I think so, so I could try use this?
What are your thoughts?

Thanks
Kim



José Luis Redrejo wrote:
> 
> gb.desktop didn't exist when I did that application... that obviously is
> easier
> 
> 2008/1/20, Benoit Minisini <gambas at ...1...>:
>>
>> On dimanche 20 janvier 2008, José Luis Redrejo wrote:
>> > 2008/1/20, Khos <kim.hoskin at ...1073...>:
>> > > Hi Jose,
>> > >
>> > > I emailed you direct but if there is anyone else who can provide
>> input
>> > > that
>> > > would be great. Am I correct in thinking that your 2 lines of code:
>> > > SHELL "xwininfo -name \"" & title & "\"| grep \"Window id\" " to
>> result1
>> > >   'result1=xwininfo: Window id: 0x3201eca "title"
>> > >
>> > > Will give me the active window's title on the Ubuntu desktop (any
>> > > app/window)?
>> >
>> > Only the first line, the second one is commented. It was just a comment
>> for
>> > me to remember the
>> > returning value of xwininfo. Here you have an example of how it works
>> if
>> > you execute it in a terminal:
>> >
>> > jose at ...1836...:~$ xwininfo -name "monitor - Gambas II"| grep "Window
>> id"
>> > xwininfo: Window id: 0x3c0000c "monitor - Gambas II"
>> >
>> >
>> > Does xwininfo program give all the info(ID/Title etc) that the mouse is
>> >
>> > > hovering over?
>> >
>> > if you take a look to "man xwininfo" you will see that you have to pass
>> it
>> > the window name or the window id and it will return all the data about
>> the
>> > window. You can also use it just clicking on the selected window to get
>> all
>> > the information. The way I use it in this code is passing the window
>> name
>> > to get the window id, as the Embedder control needs the window id. I
>> know
>> > the window name because it's launched using shell from the same
>> > application. Depending on your needs you have to choose between the
>> > different options to use xwininfo.
>> >
>> > Regards.
>> > José L.
>>
>> To find a window id from its title, you can use the Desktop.Find() method
>> of
>> the gb.desktop component.
>>
>> Regards,
>>
>> --
>> Benoit Minisini
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> 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/New-to-Gambas---coding-question-how-to-find-the-active-window-on-an-Ubuntu-7.10-desktop-tp14931902p14986572.html
Sent from the gambas-user mailing list archive at Nabble.com.





More information about the User mailing list