repaint and resize problems

Hello:
I appologize for the long code post, but it seems that
my problem would only occur if there were a lot of
controls on the screen. As a new user of wxPyton, I
can say that it was not too difficult to learn about
the controls (the hardware, so to speak), but I have
been quite frustrated (nearly ready to give up) at
trying to get the windows to resize correctly and
repaint correctly. The primary problems I have run
into are that as control sizes are dynamically
changed, the frame does not adjust accordingly, the
scroll bars disappear, and/or the repainting of
screens does not work right and I get bleed over from
one notebook tab to the next (or controls just run
together on the screen). Perhaps all of these are
easy to fix, but I just wanted to offer the exerience
of this new user. It seems like if I fix one aspect of
the problem, then another problem is caused somewhere
else. So... if anyone can help me out I would be very
grateful. I have cut down my much larger application
to about 400 lines. Here are the problems:

1) New to this little test, the main frame is not
sized correctly to fit the screen

2) If you click on the button "Next Run Least Squares
Model" you will be taken to the second tab. It might
look OK at first, but if you go back and forth between
notebook tabs like that, and use the scroll bar a bit
on the second notebook tab, you will eventually see
that the page no longer fits the controls or there is
bleed over between notebook pages. Also, if you
half-minimize the screen when on the 2nd notebook tab,
and then maximize it, the screen will be all a mess.

I also cannot seem to get the tabing to work the way I
want. I would expect the use of the tab would
circulate through all controls on a page. Instead,
the tab gets stuck in any wx.grid along the way. And
I dont believe the tab recirculates once it has gone
through all the controls.

Again, any help would be greatly appreciated. John

#!/usr/bin/env python

import wx
import wx.grid

class MixLowApp(wx.App):
  def OnInit(self):
    frame = Frame1("MixLow
Program",(50,160),(250,140))
    frame.Show()
    frame.Refresh()
    self.SetTopWindow(frame)
    return True

class MyScrolledPanelA(wx.ScrolledWindow):
  def __init__(self, parent, id):
    wx.ScrolledWindow.__init__(self, parent, -1,
size=(500,500), style= wx.TAB_TRAVERSAL)
    self.SetScrollbars(1,10,600,400)
    self.mainBoxSizer = wx.BoxSizer(wx.HORIZONTAL)
    self.c1BoxSizer = wx.BoxSizer(wx.VERTICAL)
    self.c2BoxSizer = wx.BoxSizer(wx.VERTICAL)
    self.c3BoxSizer = wx.BoxSizer(wx.VERTICAL)
    Sizer_1 = wx.Size(1,1)
    Sizer_2 = wx.Size(1,1)
    Sizer_3 = wx.Panel(self,-1,(1,1))
    Sizer_4 = wx.Panel(self,-1,(1,1))
    
    self.required = ["self.txtctrl_tray",
"self.txtctrl_date",
                "self.txtctrl_replic",
"self.txtctrl_cell",
                "self.choice_drugShort",
                "self.grid_fract",
"self.txtctrl_units",
                "self.txtctrl_rows",
"self.txtctrl_cols",
                "self.grid_conc", "self.grid_label",
                "self.grid_resp"]
        
    self.default_tray = ["self.txtctrl_time",
                    "self.txtctrl_media",
"self.txtctrl_solvent",
                    "self.txtctrl_solventRatio",
"self.txtctrl_density",
                    "self.txtctrl_other"]
        
    self.List_1 = [ ("notes", "self.txtctrl",
"wx.TextCtrl", "File Notes"),
                ("name", "self.txtctrl",
"wx.TextCtrl", "Name"),
                ("instit", "self.txtctrl",
"wx.TextCtrl", "Institution"),
                ("email", "self.txtctrl",
"wx.TextCtrl", "E-mail"),
                ("assay", "self.txtctrl",
"wx.TextCtrl", "Assay"),
                ("units", "self.txtctrl",
"wx.TextCtrl", "Units"),
                ("rows", "self.txtctrl",
"wx.TextCtrl", "# Rows"),
                ("cols", "self.txtctrl",
"wx.TextCtrl", "# Columns"),
                ("trayList", "self.listctrl",
"wx.ListBox", "Available Trays")]
        
    self.List_2 = [ ("tray", "self.txtctrl",
"wx.TextCtrl", "Tray Label"),
                ("date", "self.txtctrl",
"wx.TextCtrl", "Date"),
                ("replic", "self.txtctrl",
"wx.TextCtrl", "Replicate"),
                ("cell", "self.txtctrl",
"wx.TextCtrl", "Cell Line"),
                ("time", "self.txtctrl",
"wx.TextCtrl", "Assay Time"),
                ("media", "self.txtctrl",
"wx.TextCtrl", "Culture Media"),
                ("solvent", "self.txtctrl",
"wx.TextCtrl", "Solvent"),
                ("solventRatio", "self.txtctrl",
"wx.TextCtrl", "Solvent Ratio"),
                ("density", "self.txtctrl",
"wx.TextCtrl", "Seeding Density"),
                ("other", "self.txtctrl",
"wx.TextCtrl", "Tray Notes"),
                ("drugShort", "self.choice",
"wx.Choice", "Short Drug Name"),
                ("fract", "self.grid", "wx.grid.Grid",
"Fractional Composition")]
                    
    self.List_3 = [ ("conc", "self.grid",
"wx.grid.Grid", "Well Concentration"),
                ("label", "self.grid", "wx.grid.Grid",
"Well Label"),
                ("resp", "self.grid", "wx.grid.Grid",
"Well Response")]
    
    Len1 = len(self.List_1)
    Len2 = len(self.List_2)
    Len3 = len(self.List_3)

    allList = self.List_1 + self.List_2 + self.List_3
    for i in range(0,(Len1 + Len2+ Len3)):
      ii = eval('allList[i][0]')
      strr1 = "self.boxsizer_" + ii + " =
wx.BoxSizer(wx.VERTICAL)"
      # boxsizer_notes = wx.BoxSizer(wx.VERTICAL)
      exec(strr1)
      
      strr2 = "txt_" + ii + ' = wx.StaticText(self,
-1, label= "' + allList[i][3] + '", size=(150,-1))'
      # txt_notes = wx.StaticText(self, -1, label=
"File Notes")
      exec(strr2)
      
      strr4 = allList[i][1] + "_" + ii + "= " +
allList[i][2] + "(self, -1, size=(150,-1) )"
      # txtctrl_notes= wx.TextCtrl(self, -1,
size=(100,-1))
      exec(strr4)
      
      strr3 = "self.boxsizer_" + ii + ".Add(txt_" + ii
+ ", 0, flag=wx.TOP , border=2)"
      # boxsizer_notes.Add(txt_notes, 0, wx.TOP |
wx.EXPAND, border=0)
      exec(strr3)
      
      strr5 = "self.boxsizer_" + ii + ".Add(" +
allList[i][1] + "_" + ii + ", 1,flag= wx.BOTTOM ,
border=2)"
      # boxsizer_notes.Add(txtctrl_notes, 0, wx.BOTTOM

wx.EXPAND, border=0)

      exec(strr5)
    # --------------------------------------

    for i in range(0,Len2):
      ii = eval('self.List_2[i][0]')
      strr4 = self.List_2[i][1] + "_" + ii +
".SetMinSize((200,-1))"
      exec(strr4)
    
    for i in range(0, Len1):
      # fill c1TopBoxSizer
      ii = eval('self.List_1[i][0]')
      strr2 = "self.c1BoxSizer.Add(self.boxsizer_" +
ii + ", 0, flag= wx.ALL , border=2)"
      exec(strr2)

    self.txtctrl_rows.SetValue("30")
    self.txtctrl_cols.SetValue("12")
    self.txtctrl_rows.SetName("rows")
    self.txtctrl_cols.SetName("cols")

    self.button_drugList = wx.Button(self,-1, "Alter
Drug List")
    self.button_newTray = wx.Button(self, -1, "Add New
Tray")
    self.button_newProject = wx.Button(self, -1, "New
Project")
    self.button_loadProject = wx.Button(self, -1,
"Load Saved Project")
    self.button_setupLS = wx.Button(self, -1, "Next:
Run Least\nSquares Model")
    
    self.c1BoxSizer.Add(self.button_drugList, 0, flag=
wx.ALL, border=6 )
    self.c1BoxSizer.Add(self.button_newTray, 0 , flag=
wx.ALL, border=6)
    self.c1BoxSizer.Add(self.button_newProject, 0 ,
flag= wx.ALL, border=6)
    self.c1BoxSizer.Add(self.button_loadProject, 0 ,
flag= wx.ALL, border=6)
    self.c1BoxSizer.Add(self.button_setupLS, 0 , flag=
wx.ALL, border=6)
    
    for i in range(0, Len2):
      # fill in c2 boxsizer
      ii = eval('self.List_2[i][0]')
      strr2 = "self.c2BoxSizer.Add(self.boxsizer_" +
ii + ", 0, flag= wx.ALL, border=4)"
      exec(strr2)

    self.button_reloadTray = wx.Button(self, -1,
"Reload Tray Data")
    self.button_clearTray = wx.Button(self, -1, "Clear
Tray Data")
    self.button_delTray = wx.Button(self, -1, "Delete
Tray")
    self.button_registerTray = wx.Button(self, -1,
"Register Tray Data")
    self.button_saveDefault = wx.Button(self, -1,
"Save Data As Default")
    self.button_loadDefault = wx.Button(self, -1,
"Load Defaults")
    
    self.c2BoxSizer.Add(self.button_reloadTray, 0,
flag= wx.ALL, border=6 )
    self.c2BoxSizer.Add(self.button_clearTray, 0 ,
flag= wx.ALL, border=6)
    self.c2BoxSizer.Add(self.button_delTray, 0 , flag=
wx.ALL, border=6)
    self.c2BoxSizer.Add(self.button_saveDefault, 0 ,
flag= wx.ALL, border=6)
    self.c2BoxSizer.Add(self.button_loadDefault, 0 ,
flag= wx.ALL, border=6)
    self.c2BoxSizer.Add(self.button_registerTray, 0 ,
flag= wx.ALL, border=6)

    self.c3BoxSizer.Add(self.boxsizer_conc, 0, flag=
wx.ALL , border=20)
    self.c3BoxSizer.Add(self.boxsizer_label, 0, flag=
wx.ALL , border=20)
    self.c3BoxSizer.Add(self.boxsizer_resp, 0, flag=
wx.ALL , border=20)

    self.grid_conc.CreateGrid(30,12)
    self.grid_conc.SetDefaultColSize(55)
    self.grid_conc.SetRowLabelSize(40)
    
    self.grid_label.CreateGrid(30,12)
    self.grid_label.SetDefaultColSize(55)
    self.grid_label.SetRowLabelSize(40)
    
    self.grid_resp.CreateGrid(8,12)
    self.grid_resp.SetDefaultColSize(55)
    self.grid_resp.SetRowLabelSize(40)
    
    self.grid_fract.CreateGrid(1,2)
    #self.grid_fract.SetMinSize((200,120))
    self.grid_fract.SetDefaultColSize(100)
    self.grid_fract.SetRowLabelSize(0)
    self.grid_fract.SetColLabelValue(0,"Drug")
    self.grid_fract.SetColLabelValue(1,"Fraction")
    
    # put columns together
    self.mainBoxSizer.Add(self.c1BoxSizer, 0,
border=20)
   
self.mainBoxSizer.Add(wx.StaticLine(self,-1,size=(5,20)),
flag= wx.EXPAND|wx.CENTER )
    self.mainBoxSizer.Add(self.c2BoxSizer, 0, flag=
wx.ALL, border=0)
    self.mainBoxSizer.Add(self.c3BoxSizer, 0, flag=
wx.ALL, border=0)
    
    self.grid_fract.SetInitialSize((-1,-1))
    self.grid_conc.SetInitialSize((-1,-1))
    self.grid_label.SetInitialSize((-1,-1))
    self.grid_resp.SetInitialSize((-1,-1))
    
    self.SetSizer(self.mainBoxSizer)
    self.mainBoxSizer.Fit(self)
    
    self.Bind(wx.EVT_BUTTON, self.OnSetupLS,
self.button_setupLS)

···

########################################################################################

  def OnSetupLS(self, event):
    print "on setup LS"

    # fill in tables
    F1 = self.GetTopLevelParent()
    pB = F1.nb.panelB
    
    nrows = 20
    ncols= 12
    ntrays=20
    
    r = pB.grid_excl.GetNumberRows()
    if r > 0:
      pB.grid_excl.DeleteRows(pos=0,numRows = r)
    pB.grid_excl.InsertRows(pos=0, numRows= nrows)
    
    c = pB.grid_excl.GetNumberCols()
    if c > 0:
      pB.grid_excl.DeleteCols(pos=0,numCols = c)
    pB.grid_excl.InsertCols(pos=0, numCols=ncols)
    
    r = pB.grid_tray.GetNumberRows()
    if r > 0:
      pB.grid_tray.DeleteRows(pos=0,numRows = r)
    pB.grid_tray.InsertRows(pos=0, numRows=ntrays)

    r = pB.grid_start.GetNumberRows()
    if r > 0:
      pB.grid_start.DeleteRows(pos=0,numRows = r)
    pB.grid_start.InsertRows(pos=0, numRows= ntrays)
    
    for i in range(9):
      pB.grid_tray.SetCellValue(i,0, "1")
      pB.grid_tray.SetCellValue(i,1,"1")
      pB.grid_tray.SetCellValue(i,2,"1")
      pB.grid_tray.SetCellValue(i,3,"1")
      
      pB.grid_start.SetCellValue(i,0,"1")
      pB.grid_start.SetCellValue(i,1, "default")
      pB.grid_start.SetCellValue(i,2,"default")
      pB.grid_start.SetCellValue(i,3,"default")
      pB.grid_start.SetCellValue(i,4,"default")
      pB.grid_start.SetCellValue(i,5,"default")
      
    setTrue = [0,1,2,3,7]
    for i in setTrue:
      pB.grid_format.SetCellValue(i,0,"1")
    
    pB.grid_format.SetInitialSize((-1,-1))
    pB.grid_tray.SetInitialSize((-1,-1))
    pB.grid_start.SetInitialSize((-1,-1))
    pB.grid_excl.SetInitialSize((-1,-1))

    pB.mainBoxSizer.Layout()
    
    for i in range(8):
      pB.grid_format.SetCellRenderer(i,0,
wx.grid.GridCellBoolRenderer())
      pB.grid_format.SetCellEditor(i,0,
wx.grid.GridCellBoolEditor())
    for i in range(pB.grid_tray.GetNumberRows()):
      pB.grid_tray.SetCellRenderer(i,0,
wx.grid.GridCellBoolRenderer())
      pB.grid_tray.SetCellEditor(i,0,
wx.grid.GridCellBoolEditor())
    
    self.GetTopLevelParent().nb.SetSelection(1)

#####################################################################################
class MyScrolledPanelB(wx.ScrolledWindow):
  def __init__(self, parent, id):
    wx.ScrolledWindow.__init__(self, parent, -1,
size=(500,500), style= wx.TAB_TRAVERSAL )
    
    F1 = self.GetTopLevelParent()

    ntrays = 1
    ncols = 12
    nrows = 8
    
    # controls
    self.grid_format = wx.grid.Grid(self, -1,
size=(-1,-1))
    self.grid_tray = wx.grid.Grid(self, -1,
size=(-1,-1))
    self.grid_start = wx.grid.Grid(self, -1,
size=(-1,-1))
    self.grid_excl = wx.grid.Grid(self, -1,
size=(-1,-1))
    
    self.grid_format.CreateGrid(8,2)
    self.grid_format.SetColSize(0, 100)
    self.grid_format.SetColSize(1, 400)
    self.grid_format.SetRowLabelSize(0)
    self.grid_format.SetColLabelSize(0)
    txt = ["Legends in figures?",
           "Titles in figures?",
           "Axes labels in figures?",
           "Data from 'blanks' in figures?",
           "Table of raw and blanks-adjusted data?",
           "Table of data averaged by concentration?",
           "Table of least-squares predictions?",
           "Summary of least-squares predictions?"]
    setTrue = [0,1,2,3,7]
    for i, t in enumerate(txt):
      self.grid_format.SetCellValue(i,1, t)
      self.grid_format.SetCellRenderer(i,0,
wx.grid.GridCellBoolRenderer())
      self.grid_format.SetCellEditor(i,0,
wx.grid.GridCellBoolEditor())
      self.grid_format.SetReadOnly(i,1,True)
      if i in setTrue:
        self.grid_format.SetCellValue(i,0,"1")

    self.grid_tray.CreateGrid(ntrays,4)
    self.grid_tray.SetDefaultColSize(150)
    self.grid_tray.SetRowLabelSize(40)
    clab = ["Select", "Tray", "Cell Line",
"Replicate"]
    for c,v in enumerate (clab):
      self.grid_tray.SetColLabelValue(c,v)
    for i in range(self.grid_tray.GetNumberRows()):
      self.grid_tray.SetCellRenderer(i,0,
wx.grid.GridCellBoolRenderer())
      self.grid_tray.SetCellEditor(i,0,
wx.grid.GridCellBoolEditor())

    self.grid_start.CreateGrid(ntrays,6)
    self.grid_start.SetDefaultColSize(200)
    self.grid_start.SetRowLabelSize(40)
    self.grid_start.SetRowLabelSize(0)
    clab = ["Tray", "Log IC50", "Log IC50 stDev", "Log
Slope Factor", "Log Slope Param. stDev" , "Asymp.
Fraction"]
    for c,v in enumerate (clab):
      self.grid_start.SetColLabelValue(c,v)
    
    self.grid_excl.CreateGrid(nrows,ncols)
    self.grid_excl.SetDefaultColSize(55)
    self.grid_excl.SetRowLabelSize(40)
   
self.grid_excl.SetDefaultRenderer(wx.grid.GridCellBoolRenderer())
   
self.grid_excl.SetDefaultEditor(wx.grid.GridCellBoolEditor())
        
    self.txtctrl_random = wx.TextCtrl(self, -1, "20",
size=(50,-1))
    self.txtctrl_thresh = wx.TextCtrl(self, -1, "0",
size=(50,-1))
    self.txtctrl_file = wx.TextCtrl(self, -1,
size=(500,-1), style=wx.TE_CENTER)
    self.txtctrl_file.Enable(False)
    
    # control labels
    txt_format = wx.StaticText(self, -1, label=
"Choose Output Format For Text And Figures")
    txt_trays = wx.StaticText(self, -1, label= "Choose
Trays For Analysis")
    txt_start = wx.StaticText(self, -1, label=
"Provide Starting Estimates/Standard Deviations")
    txt_excl = wx.StaticText(self, -1, label= "Choose
Any Cells To Exclude In All Trays")
    txt_random = wx.StaticText(self, -1, label=
"Number of random samples")
    txt_thresh = wx.StaticText(self, -1, label=
"Threshold value for non-zero asymptote")
    txt_file = wx.StaticText(self, -1, label= "Data
File Name")
    
    # buttons
    self.button_saveChoices = wx.Button(self, -1,
"Save Choices")
    self.button_loadChoices = wx.Button(self, -1,
"Load Choices")
    self.button_NLS = wx.Button(self, -1, "Next: Run
Nonliear\nLeast Squares")
   
self.button_NLS.SetBackgroundColour(wx.NamedColour('light
blue') )
    
    #sizers
    self.mainBoxSizer = wx.BoxSizer(wx.VERTICAL)
    
    self.h1BoxSizer = wx.BoxSizer(wx.HORIZONTAL)
    self.h2BoxSizer = wx.BoxSizer(wx.HORIZONTAL)
    self.h3BoxSizer = wx.BoxSizer(wx.HORIZONTAL)
    self.h4BoxSizer = wx.BoxSizer(wx.HORIZONTAL)
    self.h5BoxSizer = wx.BoxSizer(wx.HORIZONTAL)
    
    self.BoxSizer_buttons = wx.BoxSizer(wx.VERTICAL)
    self.BoxSizer_file = wx.BoxSizer(wx.VERTICAL)
    self.BoxSizer_grid_format =
wx.BoxSizer(wx.VERTICAL)
    self.BoxSizer_grid_tray = wx.BoxSizer(wx.VERTICAL)
    self.BoxSizer_random = wx.BoxSizer(wx.VERTICAL)
    self.BoxSizer_thresh = wx.BoxSizer(wx.VERTICAL)
    self.BoxSizer_grid_start =
wx.BoxSizer(wx.VERTICAL)
    self.BoxSizer_grid_excl = wx.BoxSizer(wx.VERTICAL)
    
    # fit sizers widget
    self.BoxSizer_file.Add(txt_file, 0, wx.ALL,
border= 3)
    self.BoxSizer_file.Add(self.txtctrl_file, 0,
wx.ALL, border= 3)
    
    self.BoxSizer_buttons.Add(self.button_saveChoices,
0, wx.ALL, border= 3)
    self.BoxSizer_buttons.Add(self.button_loadChoices,
0, wx.ALL, border= 3)
    self.BoxSizer_buttons.Add(self.button_NLS, 0,
wx.ALL, border= 3)
    
    self.BoxSizer_grid_format.Add(txt_format, 0,
wx.ALL, border= 3)
    self.BoxSizer_grid_format.Add(self.grid_format, 0,
wx.ALL, border= 3)
    
    self.BoxSizer_grid_tray.Add(txt_trays, 0, wx.ALL,
border= 3)
    self.BoxSizer_grid_tray.Add(self.grid_tray, 0,
wx.ALL, border= 3)
        
    self.BoxSizer_random.Add(txt_random, 0, wx.ALL,
border= 3)
    self.BoxSizer_random.Add(self.txtctrl_random, 0,
wx.ALL, border= 3)
    
    self.BoxSizer_thresh.Add(txt_thresh, 0, wx.ALL,
border= 3)
    self.BoxSizer_thresh.Add(self.txtctrl_thresh, 0,
wx.ALL, border= 3)
    
    self.BoxSizer_grid_start.Add(txt_start, 0, wx.ALL,
border= 3)
    self.BoxSizer_grid_start.Add(self.grid_start, 0,
wx.ALL, border= 3)
    
    self.BoxSizer_grid_excl.Add(txt_excl, 0, wx.ALL,
border= 3)
    self.BoxSizer_grid_excl.Add(self.grid_excl, 0,
wx.ALL, border= 3)
    
    # fit sizers sizers
    self.h1BoxSizer.Add(self.BoxSizer_buttons, 0,
flag= wx.ALIGN_CENTER | wx.ALL, border = 20)
    self.h1BoxSizer.Add(self.BoxSizer_grid_format, 0,
flag= wx.ALIGN_CENTER | wx.ALL, border = 20)
    self.h2BoxSizer.Add(self.BoxSizer_grid_tray, 0,
flag= wx.ALIGN_CENTER | wx.ALL, border = 20)
    self.h3BoxSizer.Add(self.BoxSizer_random, 0, flag=
wx.ALIGN_CENTER | wx.ALL, border = 20)
    self.h3BoxSizer.Add(self.BoxSizer_thresh, 0, flag=
wx.ALIGN_CENTER | wx.ALL, border = 20)
    self.h4BoxSizer.Add(self.BoxSizer_grid_start, 0,
flag= wx.ALIGN_CENTER | wx.ALL, border = 20)
    self.h5BoxSizer.Add(self.BoxSizer_grid_excl, 0,
flag= wx.ALIGN_CENTER | wx.ALL, border = 20)

    # main boxsizer
    self.mainBoxSizer.Add(self.BoxSizer_file, 0, flag=
wx.ALIGN_CENTER | wx.ALL, border = 20)
    self.mainBoxSizer.Add(self.h1BoxSizer, 0, flag=
wx.ALIGN_CENTER | wx.ALL, border = 20)
   
self.mainBoxSizer.Add(wx.StaticLine(self,-1,size=(5,10)),
0, flag= wx.EXPAND )
    self.mainBoxSizer.Add(self.h2BoxSizer, 0, flag=
wx.ALIGN_CENTER | wx.ALL, border = 20)
   
self.mainBoxSizer.Add(wx.StaticLine(self,-1,size=(5,10)),
0, flag= wx.EXPAND )
    self.mainBoxSizer.Add(self.h3BoxSizer, 0, flag=
wx.ALIGN_BOTTOM | wx.ALIGN_CENTER | wx.TOP, border =
20)
    
    self.mainBoxSizer.Add(self.h4BoxSizer, 0, flag=
wx.ALIGN_CENTER | wx.BOTTOM, border = 20)
   
self.mainBoxSizer.Add(wx.StaticLine(self,-1,size=(5,10)),
0, flag= wx.EXPAND )
    self.mainBoxSizer.Add(self.h5BoxSizer, 0, flag=
wx.ALIGN_CENTER | wx.ALL, border = 20)
    
    self.SetSizer(self.mainBoxSizer)
    self.mainBoxSizer.Fit(self)
    
################################################################################################

class Frame1(wx.Frame):
  def __init__(self,title,pos,size):
    wx.Frame.__init__(self,None,-1,title,pos,size)
    self.SetMinSize((800,600))
    self.Maximize()

    self.nb = wx.Notebook(self, -1, style=wx.NB_TOP)
    self.nb.panelA = MyScrolledPanelA(self.nb,-1)
    self.nb.panelA.SetScrollbars(1,1,600,400)
    self.nb.panelB = MyScrolledPanelB(self.nb, -1)
    self.nb.panelB.SetScrollbars(1,1,600,400)
    
    self.nb.panelC = MyScrolledPanelB(self.nb, -1)
    self.nb.panelC.SetScrollbars(1,1,600,400)
    """
    self.nb.panelD = PD.MyScrolledPanelD(self.nb, -1)
    self.nb.panelD.SetScrollbars(1,1,600,400)
    self.nb.panelE = PE.MyScrolledPanelE(self.nb, -1)
    self.nb.panelE.SetScrollbars(1,1,600,400)
    """
    
    self.nb.AddPage(imageId=-1, page=self.nb.panelA,
select=True,text='Create Data')
    self.nb.AddPage(imageId=-1, page=self.nb.panelB,
select=False,text='Run LS')
    self.nb.AddPage(imageId=-1, page=self.nb.panelC,
select=False,text='Run NLME')
    #self.nb.AddPage(imageId=-1, page=self.nb.panelD,
select=False,text='Run Loewe')
    #self.nb.AddPage(imageId=-1, page=self.nb.panelE,
select=False,text='Loewe Results')
    self.Layout()
  
if __name__ == '__main__':
  #app = MixLowApp(True)
  app = MixLowApp(False)
  app.MainLoop()

      ____________________________________________________________________________________
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
http://autos.yahoo.com/index.html

JJ wrote:

Hello:
I appologize for the long code post, but it seems that
my problem would only occur if there were a lot of
controls on the screen. As a new user of wxPyton, I
can say that it was not too difficult to learn about
the controls (the hardware, so to speak), but I have
been quite frustrated (nearly ready to give up) at
trying to get the windows to resize correctly and
repaint correctly. The primary problems I have run
into are that as control sizes are dynamically
changed, the frame does not adjust accordingly, the
scroll bars disappear, and/or the repainting of
screens does not work right and I get bleed over from
one notebook tab to the next (or controls just run
together on the screen). Perhaps all of these are
easy to fix, but I just wanted to offer the exerience
of this new user. It seems like if I fix one aspect of
the problem, then another problem is caused somewhere
else. So... if anyone can help me out I would be very
grateful. I have cut down my much larger application
to about 400 lines. Here are the problems:

1) New to this little test, the main frame is not
sized correctly to fit the screen

2) If you click on the button "Next Run Least Squares
Model" you will be taken to the second tab. It might
look OK at first, but if you go back and forth between
notebook tabs like that, and use the scroll bar a bit
on the second notebook tab, you will eventually see
that the page no longer fits the controls or there is
bleed over between notebook pages. Also, if you
half-minimize the screen when on the 2nd notebook tab,
and then maximize it, the screen will be all a mess.

I also cannot seem to get the tabing to work the way I
want. I would expect the use of the tab would
circulate through all controls on a page. Instead,
the tab gets stuck in any wx.grid along the way. And
I dont believe the tab recirculates once it has gone
through all the controls.

Again, any help would be greatly appreciated. John

Please resend your code as an attachment so it doesn't get word-wrapped.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

wxGrid has it's own internal tab behavior. You'll need to add a
handler to your grid if you want it to "tab out" at the end.

In normal circumstances, tab navigation does loop. Please provide an
example where it's not working for you.

Your code was wrapped by your mailer and it's far too long for me to
try to reformat and fix. Please send python code as attachments
instead of inline.

Also, please try (really hard) to make it smaller.

<code snipped>

···

On 10/11/07, JJ <josh8912@yahoo.com> wrote:

Hello:
I appologize for the long code post, but it seems that
my problem would only occur if there were a lot of
controls on the screen. As a new user of wxPyton, I
can say that it was not too difficult to learn about
the controls (the hardware, so to speak), but I have
been quite frustrated (nearly ready to give up) at
trying to get the windows to resize correctly and
repaint correctly. The primary problems I have run
into are that as control sizes are dynamically
changed, the frame does not adjust accordingly, the
scroll bars disappear, and/or the repainting of
screens does not work right and I get bleed over from
one notebook tab to the next (or controls just run
together on the screen). Perhaps all of these are
easy to fix, but I just wanted to offer the exerience
of this new user. It seems like if I fix one aspect of
the problem, then another problem is caused somewhere
else. So... if anyone can help me out I would be very
grateful. I have cut down my much larger application
to about 400 lines. Here are the problems:

1) New to this little test, the main frame is not
sized correctly to fit the screen

2) If you click on the button "Next Run Least Squares
Model" you will be taken to the second tab. It might
look OK at first, but if you go back and forth between
notebook tabs like that, and use the scroll bar a bit
on the second notebook tab, you will eventually see
that the page no longer fits the controls or there is
bleed over between notebook pages. Also, if you
half-minimize the screen when on the 2nd notebook tab,
and then maximize it, the screen will be all a mess.

I also cannot seem to get the tabing to work the way I
want. I would expect the use of the tab would
circulate through all controls on a page. Instead,
the tab gets stuck in any wx.grid along the way. And
I dont believe the tab recirculates once it has gone
through all the controls.

Robin Dunn <robin <at> alldunn.com> writes:

Please resend your code as an attachment so it doesn't get word-wrapped.

My apologies for the word wrap. I have a question for the list that may or may
not be unusual. I am a postdoc quickly running out of time to complete this
project, which is very much a side project to my main work. I can complete 95%
of the project without problem, but I believe the other 5%, which is getting it
to look right (correct window size, no bleed-over from one notebook tab to the
next, scrollbars showing when they need to, etc) is going to take me too much
time. Would someone experienced be willing to work as a consultant on this
project (hopefully ony for an hour or two, for compensation)? I just sense
that there are a string of little details to work out to make it all look good,
and I have no time left to devote to it. The project itself is a GUI to run a
scientific program that I will make available for free. John