Is there a way to make a Frame a fixed size and disable to ability to
resize it?
Yes. When you instantiate the frame, you can set it's size with its
size parameter. To keep the size the same, you can set specific style
flags or better yet, use SetSizeHints.
···
On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
Is there a way to make a Frame a fixed size and disable to ability to
resize it?
-------------------
Mike Driscoll
The default window style is wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX | wxCLIP_CHILDREN. If you remove wx.RESIZE_BORDER from it, you'll get a frame which cannot be resized.
-Matthias
···
Am 21.07.2010, 15:21 Uhr, schrieb Mike Driscoll <kyosohma@gmail.com>:
On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
Is there a way to make a Frame a fixed size and disable to ability to
resize it?Yes. When you instantiate the frame, you can set it's size with its
size parameter. To keep the size the same, you can set specific style
flags or better yet, use SetSizeHints.
Hi,
Is there a way to make a Frame a fixed size and disable to ability to
resize it?Yes. When you instantiate the frame, you can set it's size with its
size parameter. To keep the size the same, you can set specific style
flags or better yet, use SetSizeHints.
Another option is to remove the RESIZE_BORDER flag from the Frames
style bitmask.
i.e)
style = wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER
wx.Frame(parent, ..., style=style)
That way it wont have the ability to be resized when the user mouses
over the border of the window.
Cody
···
On Wed, Jul 21, 2010 at 8:21 AM, Mike Driscoll <kyosohma@gmail.com> wrote:
On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
I tried to find a list of style codes but couldn't. Where do I find
them?
Are there wxPython API docs? I really just need a list of objects,
methods, properties, and constants.
···
On Jul 21, 12:21 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
> Is there a way to make a Frame a fixed size and disable to ability to
> resize it?Yes. When you instantiate the frame, you can set it's size with its
size parameter. To keep the size the same, you can set specific style
flags or better yet, use SetSizeHints.
That is incredibly helpful, thank you.
Thank you all for your quick and helpful responses. I only wish I had
an internet connection on the computer I'm developing on. ;o)
···
On Jul 21, 12:27 pm, Matthias <nitrogen...@googlemail.com> wrote:
Am 21.07.2010, 15:21 Uhr, schrieb Mike Driscoll <kyoso...@gmail.com>:
> On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
>> Is there a way to make a Frame a fixed size and disable to ability to
>> resize it?> Yes. When you instantiate the frame, you can set it's size with its
> size parameter. To keep the size the same, you can set specific style
> flags or better yet, use SetSizeHints.The default window style is wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxRESIZE_BORDER | wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX |
wxCLIP_CHILDREN. If you remove wx.RESIZE_BORDER from it, you'll get a
frame which cannot be resized.
Hi,
···
On Wed, Jul 21, 2010 at 8:31 AM, Josh Russo <josh.r.russo@gmail.com> wrote:
On Jul 21, 12:21 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
> Is there a way to make a Frame a fixed size and disable to ability to
> resize it?Yes. When you instantiate the frame, you can set it's size with its
size parameter. To keep the size the same, you can set specific style
flags or better yet, use SetSizeHints.I tried to find a list of style codes but couldn't. Where do I find
them?Are there wxPython API docs? I really just need a list of objects,
methods, properties, and constants.
http://docs.wxwidgets.org/2.8.11/wx_wxframe.html#wxframe
There are also the wxPython specific ones but I find the C++ docs far
more useful:
Cody
I also prefer the C++ docs.
There's also Andrea's wxPython docs:
http://xoomer.virgilio.it/infinity77/wxPython/Widgets/wx.Frame.html
which I like much more than the default python docs.
-Matthias
···
Am 21.07.2010, 15:34 Uhr, schrieb Cody Precord <codyprecord@gmail.com>:
Hi,
On Wed, Jul 21, 2010 at 8:31 AM, Josh Russo <josh.r.russo@gmail.com> > wrote:
On Jul 21, 12:21 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
> Is there a way to make a Frame a fixed size and disable to ability to
> resize it?Yes. When you instantiate the frame, you can set it's size with its
size parameter. To keep the size the same, you can set specific style
flags or better yet, use SetSizeHints.I tried to find a list of style codes but couldn't. Where do I find
them?Are there wxPython API docs? I really just need a list of objects,
methods, properties, and constants.http://docs.wxwidgets.org/2.8.11/wx_wxframe.html#wxframe
There are also the wxPython specific ones but I find the C++ docs far
more useful:wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
You can download the wxPython docs here: Download wxPython-docs-2.8.11.0.tar.bz2 (wxPython) .
The wxPython docs and demos also come with a chm help file which can be browsed offline. That's what I use most of the time. Andrea's AGW docs also have a very nice .chm file which you can download for offline work.
-Matthias
···
Am 21.07.2010, 15:33 Uhr, schrieb Josh Russo <josh.r.russo@gmail.com>:
Thank you all for your quick and helpful responses. I only wish I had
an internet connection on the computer I'm developing on. ;o)
Thanks! You're right, the C++ ones look much more useful.
···
On Jul 21, 12:34 pm, Cody Precord <codyprec...@gmail.com> wrote:
Hi,
On Wed, Jul 21, 2010 at 8:31 AM, Josh Russo <josh.r.ru...@gmail.com> wrote:
> On Jul 21, 12:21 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
>> On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:>> > Is there a way to make a Frame a fixed size and disable to ability to
>> > resize it?>> Yes. When you instantiate the frame, you can set it's size with its
>> size parameter. To keep the size the same, you can set specific style
>> flags or better yet, use SetSizeHints.> I tried to find a list of style codes but couldn't. Where do I find
> them?> Are there wxPython API docs? I really just need a list of objects,
> methods, properties, and constants.http://docs.wxwidgets.org/2.8.11/wx_wxframe.html#wxframe
There are also the wxPython specific ones but I find the C++ docs far
more useful:wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
Cody
For styles and most events, I use Andrea's helpful Event Hunter
script:
http://groups.google.com/group/wxPython-dev/browse_thread/thread/7c19477bbcad4ef4
It's quite handy. It requires an internet connection though.
···
On Jul 21, 8:31 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
On Jul 21, 12:21 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
> On Jul 21, 8:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
> > Is there a way to make a Frame a fixed size and disable to ability to
> > resize it?> Yes. When you instantiate the frame, you can set it's size with its
> size parameter. To keep the size the same, you can set specific style
> flags or better yet, use SetSizeHints.I tried to find a list of style codes but couldn't. Where do I find
them?Are there wxPython API docs? I really just need a list of objects,
methods, properties, and constants.
-------------------
Mike Driscoll
John, The best way is when you create your frame, use this style:
class MainFrame( wx.Frame ) :
""" This frame has all possible resizing controls disabled. """
def __init__( self, parent, id, title='MainFrame',
pos=(300, 100), size=(400, 400) ) :
# wx.SYSTEM_MENU is needed to show any buttons at all.
# Add just the buttons wanted.
# style excludes resizing
noResize_frameStyle = wx.SYSTEM_MENU | wx.CLOSE_BOX |
wx.CAPTION
wx.Frame.__init__( self, parent, -1, title=title, pos=pos,
size=size, style=noResize_frameStyle )
...
This frame style is created "from scratch".
Note that the Maximize and Minimize frame buttons have also been
intentionally left out.
As an alternative, you could define the frame style as
wx.DEFAULT_FRAME_STYLE, then take away the features you DON'T want:
frameStyle_noResize = wx.DEFAULT_FRAME_STYLE ^ \
(wx.RESIZE_BORDER | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX)
The wx.DEFAULT_FRAME_STYLE is:
wx.DEFAULT_FRAME_STYLE = \
wx.SYSTEM_MENU | wx.CLOSE_BOX | wx.CAPTION | \
wx.RESIZE_BORDER | wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX
Ray Pasco
···
On Jul 21, 9:15 am, Josh Russo <josh.r.ru...@gmail.com> wrote:
Is there a way to make a Frame a fixed size and disable to ability to
resize it?