Custom Frame Issues

Hello All,

I’m hoping someone here will be able to help me a little.

I am using the code, which is attached with minor changes, from HERE as a template for a small program. With the minor changes I can run the original code and see the desired results for the frame, however, if I add anything such as a panel that uses the full frame I lose the border drawn around the frame.

I am open to suggestions of possible solutions as I would like to use the FlatMenuBar and a status bar with this as well.

Thanks,

Mike S

fancy_frame.py (2.3 KB)

my_frame.py (2.52 KB)

panel to the frame and allow it to fill the whole area, it will cover over
the transparent corners. I would try making my panel smaller than the
frame, using a sizer and a flag=wx.ALL and border=8 or whatever width is
needed to keep the panel from overlapping the transparent corners.

···

On Thu, Apr 16, 2015 at 1:39 PM, Mike Stover <hakugin.gin@gmail.com> wrote:

Hello All,

I'm hoping someone here will be able to help me a little.

I am using the code, which is attached with minor changes, from HERE
<https://hasenj.wordpress.com/2009/04/14/making-a-fancy-window-in-wxpython/&gt;
as a template for a small program. With the minor changes I can run the
original code and see the desired results for the frame, however, if I add
anything such as a panel that uses the full frame I lose the border drawn
around the frame.

I am open to suggestions of possible solutions as I would like to use the
FlatMenuBar and a status bar with this as well.

Thanks,
Mike S

I can only guess what you tried, but it should be clear that if you add a

--
Best Regards,
Michael Moriarity

I apologize, I should have included the fact I had attempted to use sizers to keep the panel away from the corners. Using a sizer results in the frame corners appearing normally, however I am still not getting the desired appearance. I will keep trying different combinations and see how things work out.

Thanks,

Mike S

···

On Friday, April 17, 2015 at 11:48:38 AM UTC-4, Data...@gmail.com wrote:

On Thu, Apr 16, 2015 at 1:39 PM, Mike Stover hakug...@gmail.com wrote:

Hello All,

I’m hoping someone here will be able to help me a little.

I am using the code, which is attached with minor changes, from HERE as a template for a small program. With the minor changes I can run the original code and see the desired results for the frame, however, if I add anything such as a panel that uses the full frame I lose the border drawn around the frame.

I am open to suggestions of possible solutions as I would like to use the FlatMenuBar and a status bar with this as well.

Thanks,

Mike S

I can only guess what you tried, but it should be clear that if you add a panel to the frame and allow it to fill the whole area, it will cover over the transparent corners. I would try making my panel smaller than the frame, using a sizer and a flag=wx.ALL and border=8 or whatever width is needed to keep the panel from overlapping the transparent corners.


Best Regards,
Michael Moriarity

This is an untested total shot in the dark, but what about trying something like:

dc = wx.PaintDC(self.my_panel)

such that you are painting the rounded rectangle border on the panel rather than on the frame?

Che

···

On Fri, Apr 17, 2015 at 11:54 AM, Mike Stover hakugin.gin@gmail.com wrote:

I apologize, I should have included the fact I had attempted to use sizers to keep the panel away from the corners. Using a sizer results in the frame corners appearing normally, however I am still not getting the desired appearance. I will keep trying different combinations and see how things work out.

Thanks,

Mike S

On Friday, April 17, 2015 at 11:48:38 AM UTC-4, Data...@gmail.com wrote:

On Thu, Apr 16, 2015 at 1:39 PM, Mike Stover hakug...@gmail.com wrote:

Hello All,

I’m hoping someone here will be able to help me a little.

I am using the code, which is attached with minor changes, from HERE as a template for a small program. With the minor changes I can run the original code and see the desired results for the frame, however, if I add anything such as a panel that uses the full frame I lose the border drawn around the frame.

I am open to suggestions of possible solutions as I would like to use the FlatMenuBar and a status bar with this as well.

Thanks,

Mike S

I can only guess what you tried, but it should be clear that if you add a panel to the frame and allow it to fill the whole area, it will cover over the transparent corners. I would try making my panel smaller than the frame, using a sizer and a flag=wx.ALL and border=8 or whatever width is needed to keep the panel from overlapping the transparent corners.


Best Regards,
Michael Moriarity

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Che,

I just tried that, and ended up with just a corner of the program visible. At first I thought nothing was showing, but then I discovered the faint curved line of the top left corner. This may have been a result of not using a sizer.

Modifying the OnPaint a bit I was able to partially achieve what I am working towards. I have attached the example code.

main_frame.py (7.81 KB)

···

On Friday, April 17, 2015 at 12:52:27 PM UTC-4, Che M wrote:

This is an untested total shot in the dark, but what about trying something like:

dc = wx.PaintDC(self.my_panel)

such that you are painting the rounded rectangle border on the panel rather than on the frame?

Che

On Fri, Apr 17, 2015 at 11:54 AM, Mike Stover hakug...@gmail.com wrote:

I apologize, I should have included the fact I had attempted to use sizers to keep the panel away from the corners. Using a sizer results in the frame corners appearing normally, however I am still not getting the desired appearance. I will keep trying different combinations and see how things work out.

Thanks,

Mike S

On Friday, April 17, 2015 at 11:48:38 AM UTC-4, Data...@gmail.com wrote:

On Thu, Apr 16, 2015 at 1:39 PM, Mike Stover hakug...@gmail.com wrote:

Hello All,

I’m hoping someone here will be able to help me a little.

I am using the code, which is attached with minor changes, from HERE as a template for a small program. With the minor changes I can run the original code and see the desired results for the frame, however, if I add anything such as a panel that uses the full frame I lose the border drawn around the frame.

I am open to suggestions of possible solutions as I would like to use the FlatMenuBar and a status bar with this as well.

Thanks,

Mike S

I can only guess what you tried, but it should be clear that if you add a panel to the frame and allow it to fill the whole area, it will cover over the transparent corners. I would try making my panel smaller than the frame, using a sizer and a flag=wx.ALL and border=8 or whatever width is needed to keep the panel from overlapping the transparent corners.


Best Regards,
Michael Moriarity

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

After a bit more digging I discovered that only Frames can have rounded corners. While I am confident this can be worked around I am setting this particular part of my project aside. Thank you all for the help and suggestions!

···

On Thursday, April 16, 2015 at 1:39:54 PM UTC-4, Mike Stover wrote:

Hello All,

I’m hoping someone here will be able to help me a little.

I am using the code, which is attached with minor changes, from HERE as a template for a small program. With the minor changes I can run the original code and see the desired results for the frame, however, if I add anything such as a panel that uses the full frame I lose the border drawn around the frame.

I am open to suggestions of possible solutions as I would like to use the FlatMenuBar and a status bar with this as well.

Thanks,

Mike S