Changing a frame's panel?

All:

Is there a way to change the panel that a frame is displaying at the
moment? I.e., if I have a main panel that is currently displaying
panelX, can I have a button on panelX that will cause the frame to
display panelY over (or completely destroying) panelX?

TIA

Levis, Chris wrote:

Is there a way to change the panel that a frame is displaying at the
moment? I.e., if I have a main panel that is currently displaying
panelX, can I have a button on panelX that will cause the frame to
display panelY over (or completely destroying) panelX?

Sure:

wx.Window.Hide() and wx.Window.Show()

wx.Panel derives form wx.Windows, so you just Hide() one and Show() the other.

Enclosed is an example using sizers to lay it out, and the panels get replaced. It's almost a clone of wx.Notebook functionality.

-Chris

Converter.py (11.4 KB)

···

--
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

Is it possible to have the replace() command replace multiple 'keywords'?
For example: fileName.replace(".jpg"|".bmp"|".png", ".")

Result would be a filename where the extension has been removed (for filenames with .png/.jpg/.bmp extensions)

Hope I'm not being too vague :stuck_out_tongue:

Thanks in advance!

hmm, not really wxPython specific.

But if I understand you right:

How about regex:

import re

r = re.compile('\.jpg|\.bmp|\.png')
res = r.search(fileName)
if res:
  fileName = fileName[res.start()+1:]

or you use the os.path

if res:
   os.path.splitext(fileName)[0]

···

On Tue, 28 Jun 2005 10:36:29 +0200, GMail <lorenzo.fanchi@gmail.com> wrote:

Is it possible to have the replace() command replace multiple 'keywords'?
For example: fileName.replace(".jpg"|".bmp"|".png", ".")

Result would be a filename where the extension has been removed (for
filenames with .png/.jpg/.bmp extensions)

Hope I'm not being too vague :stuck_out_tongue:

Thanks in advance!

--
Franz Steinhaeusler

Oops! I’m sorry, I totally forgot this was the wxPy mailing list…

Thanks for the answer though, I’m gonna try that!

Franz Steinhäusler wrote:

···

lorenzo.fanchi@gmail.comwxPython-users-unsubscribe@lists.wxwidgets.orgwxPython-users-help@lists.wxwidgets.org