Freeze() or Disable() & SetInvisible()? Which should I do

Hello

When my Panel is less than 100 pixels in width I want to make all my
buttons & text controls go invisible & make my combobox visible.

So I am trying to figure out how to make a control( TextCtrl,
StaticText, ComboBox or Button) not visible but I dont know the
correct function. I thought there was a function called
SetVisible( False ), but it seems from the docs website that there
isn't?

Also I when I want to make a control not visible I also want to
disable it. So would it be better to just use the functions Freeze() &
Thaw() instead of doing SetVisible(False) (or the equivalent) & then
Disable(). But does Freeze() make the control go invisible aswell as
disable it?

Sascha wrote:

When my Panel is less than 100 pixels in width I want to make all my
buttons & text controls go invisible & make my combobox visible.

So I am trying to figure out how to make a control( TextCtrl,
StaticText, ComboBox or Button) not visible but I dont know the
correct function. I thought there was a function called
SetVisible( False ), but it seems from the docs website that there
isn't?

I think you are looking for Hide() and Show().

Also I when I want to make a control not visible I also want to
disable it. So would it be better to just use the functions Freeze() &
Thaw() instead of doing SetVisible(False) (or the equivalent) & then
Disable(). But does Freeze() make the control go invisible aswell as
disable it?

Freeze() and Thaw() are for a different purpose. If you are making a lot of
changes to the visible window, but do not want the user to see each change
as it happens, you call Freeze(), then make your changes, then call Thaw().
The user will only see the final result.

HTH

Frank Millman

From: wxpython-users@googlegroups.com [mailto:wxpython-
users@googlegroups.com] On Behalf Of Sascha
Sent: Tuesday, August 31, 2010 12:57 AM
To: wxPython-users
Subject: [wxPython-users] Freeze() or Disable() & SetInvisible()? Which

should I

do

Hello

When my Panel is less than 100 pixels in width I want to make all my
buttons & text controls go invisible & make my combobox visible.

So I am trying to figure out how to make a control( TextCtrl,
StaticText, ComboBox or Button) not visible but I dont know the
correct function. I thought there was a function called
SetVisible( False ), but it seems from the docs website that there
isn't?

Also I when I want to make a control not visible I also want to
disable it. So would it be better to just use the functions Freeze() &
Thaw() instead of doing SetVisible(False) (or the equivalent) & then
Disable(). But does Freeze() make the control go invisible aswell as
disable it?

--
To unsubscribe, send email to wxPython-
users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

[alm>]

What you want is Show( True/False ) and Enable( True/False ).

There's also Hide() and Disable() but I like to stay with one
descriptive function name.

See wxPython API Documentation — wxPython Phoenix 4.2.2 documentation

Freeze/Thaw is to stop screen updates until you want the update to happen.

Al

···

-----Original Message-----

Awesome, thanks guys :slight_smile:

Nice to know what freeze & thaw do also, now I can fix that flickering
I am getting :stuck_out_tongue:

thanks again

x.Show() has a complimentary function x.Hide().
x.Disable() has its compliment x.Enable().

These let you omit the unnecessary arguments "True" and "False".
In each case the default value is "True". Your code will become a bit
more clear, too.

Ray Pasco

···

On Aug 31, 5:21 am, Sascha <nill...@yahoo.com> wrote:

Awesome, thanks guys :slight_smile:

Nice to know what freeze & thaw do also, now I can fix that flickering
I am getting :stuck_out_tongue:

thanks again

Sascha,
You want to change which controls on a panel are visible when your
panel expands/shrinks to a certain size?
Does your panel grow/shrink using click-dragging borders or does it
"snap" to a certain size when you click a button or something?

If you click and drag to resize, check out the wxPython demo sizer
examples. You can set them up so that some items shrink and others
don't.

If you click a button or something to change the "layout" of the
panel, again look at the wxPython demo collapsable panel example.