[pygtk] egg.tryicon get position

daniele favara danjele at gmail.com
Sat Feb 18 03:29:03 WST 2006


On 2/17/06, Danny Milosavljevic <danny.milo at gmx.net> 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
----


More information about the pygtk mailing list