From: Ken S. <k....@co...> - 2005-02-09 03:28:52
|
Hi folks, In an app that intercepts key presses I want to control the scrolling of an HtmlWindow. The tester below moves the slider in the scroll bar but the window content doesn't move unless I click on the slider. Any hints would be appreciated. I'm running Python 2.3 on Mac OS X Thanks, Ken #!/usr/bin/python """ __version__ = "$Revision: 1.5 $" __date__ = "$Date: 2004/04/30 16:26:12 $" """ from PythonCard import model from wxPython import wx class MyBackground(model.Background): def on_initialize(self, event): self.w = self.components.HtmlWindow1 htext = '<html><body>' for i in range(50): htext = htext + "<br> line " + str(i) htext = htext + "</body></html>" self.components.HtmlWindow1.text = htext def on_UpButton_mouseClick(self, event): w = self.w curPos = w.GetScrollPos(wx.wxVERTICAL) w.SetScrollPos(wx.wxVERTICAL, curPos-13) def on_DownButton_mouseClick(self, event): w = self.w curPos = w.GetScrollPos(wx.wxVERTICAL) w.SetScrollPos(wx.wxVERTICAL, curPos+13) if __name__ == '__main__': app = model.Application(MyBackground) app.MainLoop() |