Hello all,
I have a annoying problem with the size handler of a scrolled window...
Firstly, the documentation is adamant that the size in the argument to one's
OnSize method is that of the ENTIRE window, not just it's "client area"
(i.e., an appropriate size to be passed to the SetSize() method of the
wxWindow, and NOT to the SetClientSize() method). However, the following
code, which I mentioned yesterday, produces output which indicates that it
is being called repeatedly, each time with a size which is smaller in both
directions by 6 pixels... {this is part of a wxScrolledWindow-derived
class...}
(Incidentally, before I forget, I'm running wxPython 2.2.2 on Windows 98SE.)
def OnSize(self, event):
if hasattr(self,"list") and self.list.ignore_size_events:
return
if __debug__:
Errors.InformationalMessagesWindow("%s.OnSize(width=%d,
height=%d)\n"
% (self,
event.GetSize().width,
event.GetSize().height))
self.SetSize (event.GetSize ())
if hasattr(self,"list"):
h = self.list.GetSizeTuple() [1]
self.list.SetSize (
(event.GetSize().width,
maximum.reduce([h,
event.GetSize().height])))
self.SetScrollbars(1,1,
self.list.GetSizeTuple() [0],
h)
HOWEVER, with the
self.SetSize (event.GetSize ())
changed to
self.SetClientSize (event.GetSize ())
the output generated is of the form
<C wxScrolledWindow instance at
_afa360_wxScrolledWindow_p>.OnSize(width=515, height=430)
repeated about 1450 times [which I assume means until the program runs out
of memory or some other resource (e.g. stack if this is indeed a recursion
problem)].
Does anyone have any idea where this Later problem comes from? Also, this
seems to indicate an inconsistency in this control's OnSize
event-dispatching, in that the size in the event structure/class is NOT the
size of the entire window... is this a known bug, or the result of something
incorrect in the code above, or perhaps some more subtle interaction with
other parts of my code?
Thanks,
Chris
···
-------------------------------------------------------------------------
Chris Fama <mailto:Chris.Fama@whollysnakes.com> Phone:(07) 3870 5639
Brisbane, Australia Mobile:(0400) 833 700
-------------------------------------------------------------------------
"Ask, and it will be given to you; seek, and you will find; knock, and
it will be opened to you. For everyone who asks receives, and he who
seeks finds, and to him who knocks it will be opened. - Matthew 7:7-8
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users