On 2/17/06, Danny Milosavljevic <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Am Donnerstag, den 16.02.2006, 19:41 +0100 schrieb daniele favara:
> > how can i get the position of somthing i put in systray?
> >
> > it always returs (0,0)
>
> "it" ?
>
> window.get_position() ?
>
solved thanks :)
== trayicon.window.get_origin() ==
----
def get_tray_coordinates(self,trayicon):
"""
get the trayicon coordinates to send to
notification-daemon
trayicon=egg.trayicon.TrayIcon
return : [x,y]
"""
coordinates=trayicon.window.get_origin()
size=trayicon.window.get_size()
screen=trayicon.window.get_screen()
screen_height=screen.get_height()
if coordinates[1] <= screen_height/2:
y=coordinates[1]+size[1]/2
else:
y=coordinates[1]-size[1]/2
msg_xy=[coordinates[0],y]
return msg_xy
----
http://dsslive.org
----
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/