Re: Gtkwidget under mouse cursor or type of widget



Dnia 25-02-2005, pią o godzinie 15:23 +0100, zielone napisało: :)
Is there a way to obtain pointer to any gtkwidget from other application
I click on some window and i want to receive pointer to this clicked
object

I know how i can do it in xlib, from window id in xlib i can receive
gdkwindow
But i dont know how to get gtkwidget from gdkwindow or xid:/

You can't. Widgets are only meaningful in context of GTK+, and are
internal to each application's process space. X only knows about X
windows, and that's the only type of info you can get. You can't map
from XID to <some place in address space of other process>, which is
what GTK+ widgets effectively are.

What i have to do is check what is type name of clicked window, for
example
If i clicked edit control i should receive GtkEntry, if i clicked button
control
I should receive GtkButton, i use for this
g_type_name(GTK_WIDGET_TYPE(pWidget))
But i dont have this pointer pWidget:/ for controls in my window is
simple to get widget object
But from other app i dont have idea how can i do it:/

Only way for you would be to use ATK (accessibility toolkit), which does
know about widgets (using special support built in in GTK+). Note that
it requires ATK to be enabled and support libraries to be installed, and
also won't give you pointer to something you can apply GTK_WIDGET_TYPE()
on, instead it will return set of information describing role and value
of widget suitable for accessibility application.

Maybe i can distinguish types of object in xlib or gdk???? I want to
have unique
Indetifier of object type, that i can obtain if user click frame or edit
or button etc

I don't really get that part...

HTH,
Maciej

-- 
Maciej Katafiasz <ml mathrick org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]