Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

taskbar icon screen position

0 views
Skip to first unread message

Radek

unread,
Apr 13, 2007, 12:48:26 PM4/13/07
to
Hi,

I am using wx.TaskBarIcon on Windows and need to get the screen
position of the icon in systray in order to create the frame near it.
I was hoping to get it like this (in MyTaskBarIcon class):

self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnTaskBarShow)
def OnTaskBarShow(self, evt):
screenpos = evt.GetPosition()
print screenpos

But it throws an error.

Any ideas?

Thanks,

Radek

Vadim Zeitlin

unread,
Apr 13, 2007, 5:27:56 PM4/13/07
to
On 13 Apr 2007 09:48:26 -0700 Radek <radek...@gmail.com> wrote:

R> I am using wx.TaskBarIcon on Windows and need to get the screen
R> position of the icon in systray in order to create the frame near it.
R> I was hoping to get it like this (in MyTaskBarIcon class):
R>
R> self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnTaskBarShow)
R> def OnTaskBarShow(self, evt):
R> screenpos = evt.GetPosition()
R> print screenpos
R>
R> But it throws an error.
R>
R> Any ideas?

This is currently not implemented, i.e. there is no position in
wxTaskBarIconEvent. It could be added relatively easily for Windows, I
think, but I don't know how to do it for the other platforms -- if anybody
does, please let us know (or consider contributing patches for it, of
course).

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org

Radek

unread,
Apr 15, 2007, 2:11:28 PM4/15/07
to
> R> I am using wx.TaskBarIcon on Windows and need to get the screen
> R> position of the icon in systray in order to create the frame near it.
> R> I was hoping to get it like this (in MyTaskBarIcon class):
> R>
> R> self.Bind(wx.EVT_TASKBAR_LEFT_UP, self.OnTaskBarShow)
> R> def OnTaskBarShow(self, evt):
> R> screenpos = evt.GetPosition()
> R> print screenpos
> R>
> R> But it throws an error.
> R>
> R> Any ideas?
>
> This is currently not implemented, i.e. there is no position in
> wxTaskBarIconEvent. It could be added relatively easily for Windows, I
> think, but I don't know how to do it for the other platforms -- if anybody
> does, please let us know (or consider contributing patches for it, of
> course).
>

Finally I used wx.GetMouseState in order to get the mouse position. It
is not that precise, but close enough.

What would be approach for Windows?

Radek

0 new messages