From: Ken S. <k....@co...> - 2005-02-10 02:13:03
|
I'm using: PythonCard version: 0.8.1 wxPython version: 2.5.3.1 Python version: 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] Platform: darwin and the code from Alex definitely doesn't work here. Any suggestions for Mac OS X? On Feb 9, 2005, at 7:36 AM, Alex Tweedly wrote: > Ken Sale wrote: > >> When I try the solution proposed below nothing moves, neither the >> slider of the content and clicking doesn't change anything. > > Just in case I've accidentally changed something else (I did play > around a bit with it), here are the complete source and resource files > - definitely works for me with > >> PythonCard version: 0.8.1 >> wxPython version: 2.5.3.1 >> Python version: 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit >> (Intel)] >> Platform: win32 > > > > #!/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.ScrollLines(-13) > def on_downButton_mouseClick(self, event): > w = self.w > curPos = w.GetScrollPos(wx.wxVERTICAL) > w.ScrollLines(13) > if __name__ == '__main__': > app = model.Application(MyBackground) > app.MainLoop() > > > > > {'application':{'type':'Application', > 'name':'Template', > 'backgrounds': [ > {'type':'Background', > 'name':'bgTemplate', > 'title':'Standard Template with File->Exit menu', > 'size':(400, 300), > 'style':['resizeable'], > > 'menubar': {'type':'MenuBar', > 'menus': [ > {'type':'Menu', > 'name':'menuFile', > 'label':'&File', > 'items': [ > {'type':'MenuItem', > 'name':'menuFileExit', > 'label':'E&xit', > 'command':'exit', > }, > ] > }, > ] > }, > 'components': [ > > {'type':'HtmlWindow', > 'name':'HtmlWindow1', > 'position':(10, 10), > 'size':(261, 222), > 'backgroundColor':(255, 255, 255), > }, > > {'type':'Button', > 'name':'downButton', > 'position':(283, 68), > 'label':'Down', > }, > > {'type':'Button', > 'name':'upButton', > 'position':(283, 15), > 'label':'Up', > }, > > ] # end components > } # end background > ] # end backgrounds > } } > > > -- > Alex Tweedly http://www.tweedly.net > > > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.300 / Virus Database: 265.8.6 - Release Date: 07/02/2005 > |