I am using a ShapedWindow as a popup,
and using .Move() to position it relative to where a
mouse click occurred. It works well, but I would
like to have the same behavior as PopupWindow
has with its .Position() method, namely that it
ensures that the whole popup is shown no matter
where you click, a la this post this from Robin
from Oct 2008:
wx.PopupWindow has a different method for specifying
its position, although it should have been named better.
It's Position(ptOrigin, size). The ptOrigin is always in
screen coordinates, and it takes care of ensuring that the
popup is entirely visible on screen. For example, if the
popup is used for something like a combobox and that
combo is near the bottom of the screen then you want it
to popup above the combo instead of below it.
This is coded in the C++. I'd like to do this in Python for my
shaped popup but I have not seen the C++ code and don't
quite know where to begin. Any suggestions are appreciated.
On Aug 1, 4:40 pm, C M <cmpyt...@gmail.com> wrote:
I am using a ShapedWindow as a popup,
and using .Move() to position it relative to where a
mouse click occurred. It works well, but I would
like to have the same behavior as PopupWindow
has with its .Position() method, namely that it
ensures that the whole popup is shown no matter
where you click, a la this post this from Robin
from Oct 2008:
> wx.PopupWindow has a different method for specifying
> its position, although it should have been named better.
> It's Position(ptOrigin, size). The ptOrigin is always in
> screen coordinates, and it takes care of ensuring that the
> popup is entirely visible on screen. For example, if the
> popup is used for something like a combobox and that
> combo is near the bottom of the screen then you want it
> to popup above the combo instead of below it.
This is coded in the C++. I'd like to do this in Python for my
shaped popup but I have not seen the C++ code and don't
quite know where to begin. Any suggestions are appreciated.
Thanks,
Che
I think you can browse the wx source so you could see how it's done in
C++ and then port the code. I assume it basically just takes the
position of the window, the size of the window and the display size
and checks to see if the position has pushed part of the window
outside the bounds of the display size.
I am using a ShapedWindow as a popup,
and using .Move() to position it relative to where a
mouse click occurred. It works well, but I would
like to have the same behavior as PopupWindow
has with its .Position() method, namely that it
ensures that the whole popup is shown no matter
where you click, a la this post this from Robin
from Oct 2008:
wx.PopupWindow has a different method for specifying
its position, although it should have been named better.
It's Position(ptOrigin, size). The ptOrigin is always in
screen coordinates, and it takes care of ensuring that the
popup is entirely visible on screen. For example, if the
popup is used for something like a combobox and that
combo is near the bottom of the screen then you want it
to popup above the combo instead of below it.
This is coded in the C++. I'd like to do this in Python for my
shaped popup but I have not seen the C++ code and don't
quite know where to begin. Any suggestions are appreciated.
Thanks,
Che
I think you can browse the wx source so you could see how it's done in
C++ and then port the code. I assume it basically just takes the
position of the window, the size of the window and the display size
and checks to see if the position has pushed part of the window
outside the bounds of the display size.