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.
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_BORDER | wxRESIZE_BOX | wxMAXIMIZE_BOX)
"""
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
Chris,
Hm-m-m. How interesting. On page 45 of Rappin & Dunn we read, "To remove
individual style bits from a composed style, you use the bitwise exclusive
or (XOR) operator, ^." They then provide the example of:
wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx. MINIMIZE_BOX |
wx.MAXIMIZE_BOX)
The envelope, please.
Rich
···
On Thu, 10 Hug 2006, Christopher Barker wrote:
wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BORDER | wxRESIZE_BOX | wxMAXIMIZE_BOX)
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator;
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
Rich Shepard writes:
> wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BORDER | wxRESIZE_BOX | wxMAXIMIZE_BOX)
Hm-m-m. How interesting. On page 45 of Rappin & Dunn we read, "To remove
individual style bits from a composed style, you use the bitwise exclusive
or (XOR) operator, ^." They then provide the example of:wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx. MINIMIZE_BOX |
wx.MAXIMIZE_BOX)The envelope, please.
The method Chris quoted is the one I've always used for turning off bits. I
wouldn't trust the XOR 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
···
On Thu, 10 Hug 2006, Christopher Barker wrote:
works perfect i used wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BORDER | wxRESIZE_BOX | wxMAXIMIZE_BOX) thats exactly what i was looking for
thanks
justin
···
On 8/11/06, Brian Smith smithbk@aecl.ca wrote:
Rich Shepard writes:
On Thu, 10 Hug 2006, Christopher Barker wrote:
wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BORDER | wxRESIZE_BOX | wxMAXIMIZE_BOX)
Hm-m-m. How interesting. On page 45 of Rappin & Dunn we read, "To remove
individual style bits from a composed style, you use the bitwise exclusive
or (XOR) operator, ^." They then provide the example of:wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx. MINIMIZE_BOX |
wx.MAXIMIZE_BOX)
The envelope, please.
The method Chris quoted is the one I’ve always used for turning off bits. I
wouldn’t trust the XOR method because it only works if you know for sure whatbits 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 = 0x0001print 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)
0xffffBrian
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org
Rich Shepard wrote:
wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BORDER | wxRESIZE_BOX | wxMAXIMIZE_BOX)
Chris,
Hm-m-m. How interesting. On page 45 of Rappin & Dunn we read, "To remove
individual style bits from a composed style, you use the bitwise exclusive
or (XOR) operator, ^." They then provide the example of:wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx. MINIMIZE_BOX |
wx.MAXIMIZE_BOX)
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 XOR 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 XOR is that it doesn't care if it is turning bits on or off. For example:
>>> 6 ^ 1
7
>>> 6 & ~1
6
···
On Thu, 10 Hug 2006, Christopher Barker wrote:
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Thanks for clarifying, Robin. I had just read past that page so the
example was fresh in mind.
Rich
···
On 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.
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863