On Tue, 7 Jun 2022 16:08:16 +0530 Sean Mayard wrote:
SM> @VZ I want to do it for wxPanel instead of a top level window like wxFrame.
All non top level windows are always rectangular. Of course, it's not
really a problem because what else could they be? Even if you could create
a wxPanel in a shape of a circle, what would happen with the pixels inside
the square bounding this circle but outside of the circle itself? They
would just show the wxFrame which is behind the wxPanel, which wouldn't be
very useful at all.
Again, if you want your window to have a non rectangular shape, you need
to use SetShape(). If you want to draw something inside your (rectangular)
window, just draw it -- you don't need to care about the window shape at
all.
From what you're saying it looks like you want to do something else, but
even if it's clear what it is to you, I can assure you that you don't
express it clearly in your post and that it's very difficult to understand
what exactly are you trying to do here.
SM> I read about *wxDCClipper in wxDCClipper documentation
SM> <
https://docs.wxwidgets.org/3.0/classwx_d_c_clipper.html> *but couldn't
SM> find any example of how to use it to achieve the task.
You really need to define the task first. wxDC::SetClippingRegion() allows
you to avoid drawing outside of the given region, which can be very useful,
but it's not going to help you at all if you're not drawing anything anyhow
in the first place.