[Anygui-checkins] CVS: anygui/doc tutorial.txt,1.4,1.5
Brought to you by:
mlh
From: Magnus L. H. <ml...@us...> - 2003-02-16 02:11:27
|
Update of /cvsroot/anygui/anygui/doc In directory sc8-pr-cvs1:/tmp/cvs-serv11887 Modified Files: tutorial.txt Log Message: Index: tutorial.txt =================================================================== RCS file: /cvsroot/anygui/anygui/doc/tutorial.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** tutorial.txt 24 Apr 2002 15:57:03 -0000 1.4 --- tutorial.txt 16 Feb 2003 02:11:24 -0000 1.5 *************** *** 1,5 **** Title: Anygui Tutorial Author: Magnus Lie Hetland ! Date: 2002-01-04 1. Introduction --- 1,5 ---- Title: Anygui Tutorial Author: Magnus Lie Hetland ! Date: 2003-02-16 1. Introduction *************** *** 55,65 **** from anygui import * - win = Window() app = Application() app.add(win) There; we've created a Window object, an Application object, and added the Window to the Application (otherwise it wouldn't show up ! anywhere). This won't do anything by itself; we need to tell the Application --- 55,66 ---- from anygui import * app = Application() + win = Window() app.add(win) There; we've created a Window object, an Application object, and added the Window to the Application (otherwise it wouldn't show up ! anywhere). You should create your Application object before your ! other Anygui components (including Windows). This won't do anything by itself; we need to tell the Application *************** *** 218,222 **** and link it to the button: ! def handler(**kw): txt.text = sentence() --- 219,223 ---- and link it to the button: ! def handler(event): txt.text = sentence() *************** *** 240,246 **** (Note: Event handlers receive information about the event through ! keyword arguments, such as event type, the time when the event ! occurred etc. We simply ignore all that here, using the **kw syntax ! to allow any keywords.) 9. Further Exploration --- 241,247 ---- (Note: Event handlers receive information about the event through ! Event objects. We ignore the specifics of these objects here. In ! version 0.1.1 and earlier, event handlers received information ! through keyword arguments.) 9. Further Exploration *************** *** 318,321 **** --- 319,324 ---- return ' '.join(words) + app = Application() + win = Window() *************** *** 328,335 **** win.height = txt.height + btn.height + 30 ! def handler(**kw): txt.text = sentence() link(btn, 'click', handler) - app = Application() app.add(win) app.run() --- 331,337 ---- win.height = txt.height + btn.height + 30 ! def handler(event): txt.text = sentence() link(btn, 'click', handler) app.add(win) app.run() |