[Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

Matt D md123 at nycap.rr.com
Sat Jun 8 03:22:33 CEST 2013


>>> Scrolled panel is just a graphical container that allows for scrolling inside,
>>> but it is the window that scrolls not widgets inside it. This of it like
>>> a webpage that scrolls. If you use web email the text widget in the
>>> email needs to scroll so you can see your full email context and not
>>> just scroll the page.
>>>
>>> You will probably need to create a TextCtrl with the appropriate style
>>> and append your new data. I have given an example below that should
>>> automatically scroll with your new data.
>>>
>>> #in __init__
>>> self.scrolling_widget = wx.TextCtrl( self, wx.ID_ANY, '', size=(-1, 275),
>> style=wx.TE_AUTO_SCROLL|wx.TE_READONLY|wx.TE_PROCESS_ENTER|wx.TE_WORDWRAP|wx.TE_MULTILINE )
>>>
Hey,
I added this the above 3 lines of code to my file and ran it.  the box
shows up on the far left, mostly of the pane, to the left of the current
text feilds.  I am having trouble positioning this textbox under where
the current text fields are.
I am not sure but maybe this sets up the grid on the pane:
	sizer = wx.GridBagSizer(hgap=10, vgap=10)
        self.fields = {}
all the current TextCtrl fields are positioned at (1,1) through (5,5).
I tried adding:
	sizer.Add(field, pos=(1,6))
but it did not move the box to the position?

THanks,
Matt




More information about the Tutor mailing list