I downloaded last updates from andy47:
walkthrough1.html 1.16
GettingStarted/starter1.py 1.7
GettingStarted/starter1.rsrc.py 1.4
<quote>
from PythonCard import model
Change that so it says:
from PythonCard import dialog, model
Save the code.
</quote>
No need to change, contains already "dialog"
<quote>
Double-click the "starter1" application.
When the window appears, select the Exit option from
the File menu.
You'll see a small dialog appear as described above.
<quote>
Does not work on my machine:
Windows 2000, Python 2.3, PythonCard 0.8.3
PythonCard looks very promising, walkthroughs like this
are very important to lower the threshold for new users,
as well as the (excellent) sample applications.
An overview of the framework would also be nice (
overview graph with components + methods, ...)
Looking forward doing great things with PythonCard.
Best regards
Ronny De Winter
Logged In: YES
user_id=1080808
Fixed in CVS 2005/12/17
Logged In: YES
user_id=648344
This has probably nothing to do with Windows. The main
problem is, that on the resource file starter1.rsrc.py the
exit button is associated with the built-in function 'exit',
and overrides any method you are adding. Change
'command':'exit' to 'command':None and it should work.
Still, in the version I downloaded recently there is also
the method "on_menuFileExit_select" for exiting missing.
The working starter1.py should look like this:
#!/usr/bin/python
"""
__version__ = "$Revision: 1.6 $"
__date__ = "$Date: 2004/05/05 16:53:23 $"
"""
from PythonCard import dialog, model
class abcd(model.Background):
def on_menuFileExit_select(self, event):
result = dialog.alertDialog(self,
self.components.field1.text, 'Showing Off')
if __name__ == '__main__':
app = model.Application(abcd)
app.MainLoop()
I suppose someone should either fix the starter1.* files
back to what they probably were some time ago, or change the
walkthrough1 (also walkthrough2 needs some update then).
- Josef