Get taskbar height

I have a small app that pops up to display some information
occasionally. I would like to be able to put it down in the lower
right corner so it can be more out-of-the-way, but I can't figure out
how to have it avoid being under the taskbar (Start bar). It
currently does:
     self.SetPosition(wx.Point(*wx.DisplaySize())-wx.Point
(*self.GetSize()))
but that ends up hiding the lower 40 px or so under the taskbar. I
can fudge it obviously, but the size can vary all over depending on
theme, OS, if it's expanded beyond 1 row, etc. Is there a way to grab
the height of the taskbar so I can account for it, or is there some
other method that would automatically place the window in the lower
corner accounting for the taskbar?

Hi,

I have a small app that pops up to display some information
occasionally. I would like to be able to put it down in the lower
right corner so it can be more out-of-the-way, but I can't figure out
how to have it avoid being under the taskbar (Start bar). It
currently does:
self.SetPosition(wx.Point(*wx.DisplaySize())-wx.Point
(*self.GetSize()))

You will want to use wx.Display for this, just get the Geometry and
subtract the ClientArea from it to get the TaskBar size.

but that ends up hiding the lower 40 px or so under the taskbar. I
can fudge it obviously, but the size can vary all over depending on
theme, OS, if it's expanded beyond 1 row, etc. Is there a way to grab
the height of the taskbar so I can account for it, or is there some
other method that would automatically place the window in the lower
corner accounting for the taskbar?

The taskbar position can also vary (i.e it can be on the
top/bottom/right/left side of the screen as well :wink: )

Cody

···

On Tue, Oct 13, 2009 at 9:01 AM, Nick Timkovich <prometheus235@gmail.com> wrote:

Got it working properly, thanks!

corner = wx.GetClientDisplayRect().GetBottomRight() + wx.Point(1,1)
self.SetPosition(corner-wx.Point(*self.GetSize()))

Nick

···

On Oct 13, 11:14 am, Cody Precord <codyprec...@gmail.com> wrote:

Hi,

On Tue, Oct 13, 2009 at 9:01 AM, Nick Timkovich <prometheus...@gmail.com> wrote:

> I have a small app that pops up to display some information
> occasionally. I would like to be able to put it down in the lower
> right corner so it can be more out-of-the-way, but I can't figure out
> how to have it avoid being under the taskbar (Start bar). It
> currently does:
> self.SetPosition(wx.Point(*wx.DisplaySize())-wx.Point
> (*self.GetSize()))

You will want to use wx.Display for this, just get the Geometry and
subtract the ClientArea from it to get the TaskBar size.

> but that ends up hiding the lower 40 px or so under the taskbar. I
> can fudge it obviously, but the size can vary all over depending on
> theme, OS, if it's expanded beyond 1 row, etc. Is there a way to grab
> the height of the taskbar so I can account for it, or is there some
> other method that would automatically place the window in the lower
> corner accounting for the taskbar?

The taskbar position can also vary (i.e it can be on the
top/bottom/right/left side of the screen as well :wink: )

Cody