Examples/guidelines for implementing either wx.ScrolledWindow or wx.lib.scrolledpanel?

Like subject line says…?

Issue is that my implementation using following bits of code - stripped out a lot to post here - doesn’t seem to handle/implement presenting a scrollbar as such - not too worried about automatic scrolling as such right at mometn, but, want guys to bo be able to scroll down if they want to:

#start ‘sample’ code

class additionalData(wx.Frame):

def init(self, *args, **kwargs):

super(additionalData, self).__init__(*args, **kwargs)

self.initUI()

self.Fit()

self.Centre()

self.Show()

def initUI(self):

sizer = wx.BoxSizer()

panel = wx.Panel(self)

sizer.Add(panel, 1, wx.EXPAND)

vBox = wx.BoxSizer(wx.VERTICAL)

#here I add multiple controls like StaticText and TextCtrl to a wx.FlexGridSizer

#and then

vBox.Add(fgs, flag=wx.ALIGN_CENTER|wx.CENTER|wx.ALL, border=10)

panel.SetSizer(vBox)

self.SetSizer(sizer)

#end ‘sample code’

Either way, code executes fine, I can populate values in fields, etc. and all works fine from my side, tabbing control to control, etc., but, apparently, according to sighted tester, there’s no scroll bar appearing?

Can also provide more code if you need/want to see all of it?

TIA

Jacob Kruger
Blind Biker
Skype: BlindZA
‘…fate had broken his body, but not his spirit…’

Jacob Kruger wrote:

Like subject line says..?
Issue is that my implementation using following bits of code - stripped
out a lot to post here - doesn't seem to handle/implement presenting a
scrollbar as such - not too worried about automatic scrolling as such
right at mometn, but, want guys to bo be able to scroll down if they
want to:
#start 'sample' code

#end 'sample code'
Either way, code executes fine, I can populate values in fields, etc.
and all works fine from my side, tabbing control to control, etc., but,
apparently, according to sighted tester, there's no scroll bar appearing?
Can also provide more code if you need/want to see all of it?

  If you use a wx.lib.scrolledpanel in place of your current use of wx.Panel, and then call its SetupScrolling method after all the widgets and sizers have been added, then you should get what you are looking for. The virtual size of the scrolled panel will be set to the min size needed by the sizer and the panel will get scrollbars if the virtual size is larger than the actual size. The panel will be scrolled if needed as the user tabs to each of the controls, or they can manually scroll the panel with the mouse.

···

--
Robin Dunn
Software Craftsman

Robin, so, the following in __init__:
#start code
    super(Example, self).__init__(*args, **kwargs)
    self.InitUI()
    self.Centre()
    self.CreateStatusBar()
    self.SetStatusText("")
    self.Fit()
    self.Show()
#end of __init__ code

code inside initUI(self) method:
#start code
      sizer = wx.BoxSizer()
      panel = wx.lib.scrolledpanel.ScrolledPanel(self)
      sizer.Add(panel, 1, wx.EXPAND)
      vBox = wx.BoxSizer(wx.VERTICAL)
      #add multiple sizer containers and controls to inside vBox
      #...
      #code continues
      panel.SetSizer(vBox)
      panel.SetupScrolling()
      self.SetSizer(sizer)
#end of code inside initUI(self) method

Should that work? Asking since while it executes with no errors,
unfortunately, I can't myself tell off-hand if it's worked as desired,
etc...<smile>

Suppose can also, start off by in any case specifying an initial rendering
size in the call to/via super?

And, this is all inside a class being declared as:
class Example(wx.Frame):

Thanks again

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

···

----- Original Message ----- From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 09:08 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either
wx.ScrolledWindow or wx.lib.scrolledpanel?

Jacob Kruger wrote:

Like subject line says..?
Issue is that my implementation using following bits of code - stripped
out a lot to post here - doesn't seem to handle/implement presenting a
scrollbar as such - not too worried about automatic scrolling as such
right at mometn, but, want guys to bo be able to scroll down if they
want to:
#start 'sample' code

#end 'sample code'
Either way, code executes fine, I can populate values in fields, etc.
and all works fine from my side, tabbing control to control, etc., but,
apparently, according to sighted tester, there's no scroll bar appearing?
Can also provide more code if you need/want to see all of it?

If you use a wx.lib.scrolledpanel in place of your current use of
wx.Panel, and then call its SetupScrolling method after all the widgets
and sizers have been added, then you should get what you are looking for.
The virtual size of the scrolled panel will be set to the min size needed
by the sizer and the panel will get scrollbars if the virtual size is
larger than the actual size. The panel will be scrolled if needed as the
user tabs to each of the controls, or they can manually scroll the panel
with the mouse.

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

And, here's the test code attached.

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

sizerExperiment3.py (5.16 KB)

···

----- Original Message ----- From: "Jacob Kruger" <jacob@blindza.co.za>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 10:15 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either wx.ScrolledWindow or wx.lib.scrolledpanel?

Robin, so, the following in __init__:
#start code
   super(Example, self).__init__(*args, **kwargs)
   self.InitUI()
   self.Centre()
   self.CreateStatusBar()
   self.SetStatusText("")
   self.Fit()
   self.Show()
#end of __init__ code

code inside initUI(self) method:
#start code
     sizer = wx.BoxSizer()
     panel = wx.lib.scrolledpanel.ScrolledPanel(self)
     sizer.Add(panel, 1, wx.EXPAND)
     vBox = wx.BoxSizer(wx.VERTICAL)
     #add multiple sizer containers and controls to inside vBox
     #...
     #code continues
     panel.SetSizer(vBox)
     panel.SetupScrolling()
     self.SetSizer(sizer)
#end of code inside initUI(self) method

Should that work? Asking since while it executes with no errors,
unfortunately, I can't myself tell off-hand if it's worked as desired,
etc...<smile>

Suppose can also, start off by in any case specifying an initial rendering
size in the call to/via super?

And, this is all inside a class being declared as:
class Example(wx.Frame):

Thanks again

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 09:08 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either
wx.ScrolledWindow or wx.lib.scrolledpanel?

Jacob Kruger wrote:

Like subject line says..?
Issue is that my implementation using following bits of code - stripped
out a lot to post here - doesn't seem to handle/implement presenting a
scrollbar as such - not too worried about automatic scrolling as such
right at mometn, but, want guys to bo be able to scroll down if they
want to:
#start 'sample' code

#end 'sample code'
Either way, code executes fine, I can populate values in fields, etc.
and all works fine from my side, tabbing control to control, etc., but,
apparently, according to sighted tester, there's no scroll bar appearing?
Can also provide more code if you need/want to see all of it?

If you use a wx.lib.scrolledpanel in place of your current use of
wx.Panel, and then call its SetupScrolling method after all the widgets
and sizers have been added, then you should get what you are looking for.
The virtual size of the scrolled panel will be set to the min size needed
by the sizer and the panel will get scrollbars if the virtual size is
larger than the actual size. The panel will be scrolled if needed as the
user tabs to each of the controls, or they can manually scroll the panel
with the mouse.

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

And, now, when was trying to get someone else to test this for me, turns out py2exe can't perform forms of compilation when using this wx.lib.scrolledpanel.ScrolledPanel replacement for wx.Panel - so, no-go at moment.

As in it generates .exe output, but, when you run it, you get the following error message dumped into a .log file:
Traceback (most recent call last):
  File "sizerExperiment4.py", line 2, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "wx\__init__.pyo", line 45, in <module>
  File "zipextimporter.pyo", line 82, in load_module
  File "wx\_core.pyo", line 125, in <module>
AttributeError: 'module' object has no attribute 'PROCESS_ENTER'

Think/seems will have to just forget about scrolling, and try split up data entry screens into pieces that can sort of force rendering of size of, to hope they then fit onto screens - and hope can get size forcing right as well...LOL!

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

···

----- Original Message ----- From: "Jacob Kruger" <jacob@blindza.co.za>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 11:30 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either wx.ScrolledWindow or wx.lib.scrolledpanel?

And, here's the test code attached.

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Jacob Kruger" <jacob@blindza.co.za>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 10:15 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either
wx.ScrolledWindow or wx.lib.scrolledpanel?

Robin, so, the following in __init__:
#start code
   super(Example, self).__init__(*args, **kwargs)
   self.InitUI()
   self.Centre()
   self.CreateStatusBar()
   self.SetStatusText("")
   self.Fit()
   self.Show()
#end of __init__ code

code inside initUI(self) method:
#start code
     sizer = wx.BoxSizer()
     panel = wx.lib.scrolledpanel.ScrolledPanel(self)
     sizer.Add(panel, 1, wx.EXPAND)
     vBox = wx.BoxSizer(wx.VERTICAL)
     #add multiple sizer containers and controls to inside vBox
     #...
     #code continues
     panel.SetSizer(vBox)
     panel.SetupScrolling()
     self.SetSizer(sizer)
#end of code inside initUI(self) method

Should that work? Asking since while it executes with no errors,
unfortunately, I can't myself tell off-hand if it's worked as desired,
etc...<smile>

Suppose can also, start off by in any case specifying an initial rendering
size in the call to/via super?

And, this is all inside a class being declared as:
class Example(wx.Frame):

Thanks again

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 09:08 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either
wx.ScrolledWindow or wx.lib.scrolledpanel?

Jacob Kruger wrote:

Like subject line says..?
Issue is that my implementation using following bits of code - stripped
out a lot to post here - doesn't seem to handle/implement presenting a
scrollbar as such - not too worried about automatic scrolling as such
right at mometn, but, want guys to bo be able to scroll down if they
want to:
#start 'sample' code

#end 'sample code'
Either way, code executes fine, I can populate values in fields, etc.
and all works fine from my side, tabbing control to control, etc., but,
apparently, according to sighted tester, there's no scroll bar
appearing?
Can also provide more code if you need/want to see all of it?

If you use a wx.lib.scrolledpanel in place of your current use of
wx.Panel, and then call its SetupScrolling method after all the widgets
and sizers have been added, then you should get what you are looking for.
The virtual size of the scrolled panel will be set to the min size needed
by the sizer and the panel will get scrollbars if the virtual size is
larger than the actual size. The panel will be scrolled if needed as the
user tabs to each of the controls, or they can manually scroll the panel
with the mouse.

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

OK, another update - took, and modified a slightly different version of the setup.py for py2exe that includes packaging MS runtime files/DLL's in library.zip, etc., and .exe output now seems to work, but anyway...

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

···

----- Original Message ----- From: "Jacob Kruger" <jacob@blindza.co.za>
To: <wxpython-users@googlegroups.com>
Sent: Friday, January 10, 2014 09:22 AM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either wx.ScrolledWindow or wx.lib.scrolledpanel?

And, now, when was trying to get someone else to test this for me, turns out py2exe can't perform forms of compilation when using this wx.lib.scrolledpanel.ScrolledPanel replacement for wx.Panel - so, no-go at moment.

As in it generates .exe output, but, when you run it, you get the following error message dumped into a .log file:
Traceback (most recent call last):
File "sizerExperiment4.py", line 2, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "wx\__init__.pyo", line 45, in <module>
File "zipextimporter.pyo", line 82, in load_module
File "wx\_core.pyo", line 125, in <module>
AttributeError: 'module' object has no attribute 'PROCESS_ENTER'

Think/seems will have to just forget about scrolling, and try split up data entry screens into pieces that can sort of force rendering of size of, to hope they then fit onto screens - and hope can get size forcing right as well...LOL!

Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Jacob Kruger" <jacob@blindza.co.za>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 11:30 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either wx.ScrolledWindow or wx.lib.scrolledpanel?

And, here's the test code attached.

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Jacob Kruger" <jacob@blindza.co.za>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 10:15 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either
wx.ScrolledWindow or wx.lib.scrolledpanel?

Robin, so, the following in __init__:
#start code
   super(Example, self).__init__(*args, **kwargs)
   self.InitUI()
   self.Centre()
   self.CreateStatusBar()
   self.SetStatusText("")
   self.Fit()
   self.Show()
#end of __init__ code

code inside initUI(self) method:
#start code
     sizer = wx.BoxSizer()
     panel = wx.lib.scrolledpanel.ScrolledPanel(self)
     sizer.Add(panel, 1, wx.EXPAND)
     vBox = wx.BoxSizer(wx.VERTICAL)
     #add multiple sizer containers and controls to inside vBox
     #...
     #code continues
     panel.SetSizer(vBox)
     panel.SetupScrolling()
     self.SetSizer(sizer)
#end of code inside initUI(self) method

Should that work? Asking since while it executes with no errors,
unfortunately, I can't myself tell off-hand if it's worked as desired,
etc...<smile>

Suppose can also, start off by in any case specifying an initial rendering
size in the call to/via super?

And, this is all inside a class being declared as:
class Example(wx.Frame):

Thanks again

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Robin Dunn" <robin@alldunn.com>
To: <wxpython-users@googlegroups.com>
Sent: Thursday, January 09, 2014 09:08 PM
Subject: Re: [wxPython-users] Examples/guidelines for implementing either
wx.ScrolledWindow or wx.lib.scrolledpanel?

Jacob Kruger wrote:

Like subject line says..?
Issue is that my implementation using following bits of code - stripped
out a lot to post here - doesn't seem to handle/implement presenting a
scrollbar as such - not too worried about automatic scrolling as such
right at mometn, but, want guys to bo be able to scroll down if they
want to:
#start 'sample' code

#end 'sample code'
Either way, code executes fine, I can populate values in fields, etc.
and all works fine from my side, tabbing control to control, etc., but,
apparently, according to sighted tester, there's no scroll bar
appearing?
Can also provide more code if you need/want to see all of it?

If you use a wx.lib.scrolledpanel in place of your current use of
wx.Panel, and then call its SetupScrolling method after all the widgets
and sizers have been added, then you should get what you are looking for.
The virtual size of the scrolled panel will be set to the min size needed
by the sizer and the panel will get scrollbars if the virtual size is
larger than the actual size. The panel will be scrolled if needed as the
user tabs to each of the controls, or they can manually scroll the panel
with the mouse.

--
Robin Dunn
Software Craftsman
http://wxPython.org

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.