Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • stopping window from resizing

    6 answers - 185 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    ok im sure there is a way and ive looked all over the place but i cant seem
    to find any way to make a frame that is unable to be resized, any help would
    be appreciated.
  • No.1 | | 597 bytes | |

    justin mcguire wrote:
    ok im sure there is a way and ive looked all over the place but i cant seem
    to find any way to make a frame that is unable to be resized,

    SetSizeHints() will do it, if you set the minSize and maxSize the same.

    There is also this hint in the wx docs, under wx.Frame Window styles:

    """
    The default frame style is for normal, resizeable frames. To create a
    frame which can not be resized by user, you may use the following
    combination of styles:

    wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BRDER | wxRESIZE_BX | wxMAXIMIZE_BX)
    """
    -Chris
  • No.2 | | 483 bytes | |

    Thu, 10 Hug 2006, Christopher Barker wrote:

    wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BRDER | wxRESIZE_BX | wxMAXIMIZE_BX)

    Chris,

    Hm-m-m. How interesting. page 45 of Rappin & Dunn we read, "To remove
    individual style bits from a composed style, you use the bitwise exclusive
    or (XR) operator, ^." They then provide the example of:

    wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BRDER | wx. MINIMIZE_BX |
    wx.MAXIMIZE_BX)

    The envelope, please.

    Rich
  • No.3 | | 1374 bytes | |

    Rich Shepard writes:

    Thu, 10 Hug 2006, Christopher Barker wrote:

    wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BRDER | wxRESIZE_BX | wxMAXIMIZE_BX)

    Hm-m-m. How interesting. page 45 of Rappin & Dunn we read, "To remove
    individual style bits from a composed style, you use the bitwise exclusive
    or (XR) operator, ^." They then provide the example of:

    wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BRDER | wx. MINIMIZE_BX |
    wx.MAXIMIZE_BX)

    The envelope, please.

    The method Chris quoted is the one I've always used for turning off bits. I
    wouldn't trust the XR method because it only works if you know for sure what
    bits are currently set in the initial value. If someone decides to change
    that value then you'll actually start turning bits on, not off.

    Example:

    INITIAL_VALUE = 0xffff
    UNWANTED_BIT = 0x0001
    print hex(INITIAL_VALUE & ~ UNWANTED_BIT)
    0xfffe
    print hex(INITIAL_VALUE ^ UNWANTED_BIT)
    0xfffe
    INITIAL_VALUE = 0xfffe # Some evil person has changed our initial value!
    print hex(INITIAL_VALUE & ~ UNWANTED_BIT)
    0xfffe
    print hex(INITIAL_VALUE ^ UNWANTED_BIT)
    0xffff

    Brian

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.4 | | 1672 bytes | |

    works perfect i used wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BRDER |
    wxRESIZE_BX | wxMAXIMIZE_BX) thats exactly what i was looking for

    thanks
    justin

    8/11/06, Brian Smith <smithbk (AT) aecl (DOT) cawrote:

    Rich Shepard writes:

    Thu, 10 Hug 2006, Christopher Barker wrote:

    wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BRDER | wxRESIZE_BX |
    wxMAXIMIZE_BX)

    Hm-m-m. How interesting. page 45 of Rappin & Dunn we read, "To
    remove
    individual style bits from a composed style, you use the bitwise
    exclusive
    or (XR) operator, ^." They then provide the example of:

    wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BRDER | wx. MINIMIZE_BX |
    wx.MAXIMIZE_BX)

    The envelope, please.

    The method Chris quoted is the one I've always used for turning off
    bits. I
    wouldn't trust the XR method because it only works if you know for sure
    what
    bits are currently set in the initial value. If someone decides to change
    that value then you'll actually start turning bits on, not off.

    Example:

    INITIAL_VALUE = 0xffff
    UNWANTED_BIT = 0x0001
    print hex(INITIAL_VALUE & ~ UNWANTED_BIT)
    0xfffe
    print hex(INITIAL_VALUE ^ UNWANTED_BIT)
    0xfffe
    INITIAL_VALUE = 0xfffe # Some evil person has changed our initial
    value!
    print hex(INITIAL_VALUE & ~ UNWANTED_BIT)
    0xfffe
    print hex(INITIAL_VALUE ^ UNWANTED_BIT)
    0xffff

    Brian
    >
    >
    >


    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
    --
  • No.5 | | 1300 bytes | |

    Rich Shepard wrote:
    Thu, 10 Hug 2006, Christopher Barker wrote:

    >wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BRDER | wxRESIZE_BX |
    >wxMAXIMIZE_BX)


    Chris,

    Hm-m-m. How interesting. page 45 of Rappin & Dunn we read, "To remove
    individual style bits from a composed style, you use the bitwise exclusive
    or (XR) operator, ^." They then provide the example of:

    wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BRDER | wx. MINIMIZE_BX |
    wx.MAXIMIZE_BX)

    That can work too[1], but it is typically done with ANDing the bitwise
    compliment into the original value. I've added an errata to change the
    text to show it that way.

    [1] A bitwise XR sets a 1 bit if only one of the bits compared was a 1.
    For example:

    1 == 001 binary
    2 == 010 binary
    4 == 100 binary
    6 == 110 binary

    6 ^ 2
    4
    6 ^ 4
    2
    6 ^ 6
    0

    Using the AND with the bitwise complement (inversion of the bits)
    accomplishes the same thing since AND will only result in a 1 if both of
    the bits compared are 1. For example:

    6 & ~2
    4
    6 & ~4
    2
    6 & ~6
    0

    The problem with XR is that it doesn't care if it is turning bits on or
    off. For example:

    6 ^ 1
    7
    6 & ~1
    6
  • No.6 | | 340 bytes | |

    Fri, 11 Aug 2006, Robin Dunn wrote:

    That can work too[1], but it is typically done with ANDing the bitwise
    compliment into the original value. I've added an errata to change the
    text to show it that way.

    Thanks for clarifying, Robin. I had just read past that page so the
    example was fresh in mind.

    Rich

Re: stopping window from resizing


max 4000 letters.
Your nickname that display:
In order to stop the spam: 4 + 3 =
QUESTION ON "Python"

EMSDN.COM