[Anygui-checkins] CVS: anygui/test test_combobox.py,NONE,1.1 test_openfiledlg.py,1.2,1.3 test_aboutd
Brought to you by:
mlh
From: Dallas T. J. <pan...@us...> - 2002-11-16 12:41:14
|
Update of /cvsroot/anygui/anygui/test In directory usw-pr-cvs1:/tmp/cvs-serv24516/test Modified Files: test_openfiledlg.py test_aboutdlg.py Added Files: test_combobox.py Log Message: dded frontend widgets and ported ComboBox to the new architecture. Still some layout bugs in cb, but that will be fixed by tomorrow. Also, changed the dialogs to remove Anygui, and fixed OpenFileDialog to pretty much work perfectly now. We just need to think of a clean way to have dialogs return their values. --- NEW FILE: test_combobox.py --- from anygui import * from anygui.Utils import log class SelectionPrinter: def __init__(self, cb): self._cb = cb link(cb, self.print_selection) def print_selection(self, event): log('Item selected:', self._cb.selection, '(%s)' % self._cb.items[self._cb.selection]) app = Application() cb = ComboBox() sp = SelectionPrinter(cb) cb.installItemsModel(ListModel('There was a wee cooper of county Fyfe, Nickety, nockety, noo, noo, noo'.split())) cb.selection = 2 win = Window(title='ComboBox test', width=200, height=200) win.add(cb, left=25, top=25, right=25, hstretch=1) app.add(win) app.run() Index: test_openfiledlg.py =================================================================== RCS file: /cvsroot/anygui/anygui/test/test_openfiledlg.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** test_openfiledlg.py 13 Nov 2002 18:47:51 -0000 1.2 --- test_openfiledlg.py 16 Nov 2002 12:41:11 -0000 1.3 *************** *** 1,6 **** from anygui import * app = Application(name='Test OpenFileDlg', version='1.0') ! filedlg = AnyguiOpenFileDlg('/usr/lib','*') app.add(filedlg) app.run() --- 1,13 ---- from anygui import * + import sys + + dir='' + if sys.platform in ['cygwin', 'linux1', 'linux2']: + dir='/usr/lib' + else: + dir='C:\\' app = Application(name='Test OpenFileDlg', version='1.0') ! filedlg = OpenFileDialog(dir,'*') app.add(filedlg) app.run() Index: test_aboutdlg.py =================================================================== RCS file: /cvsroot/anygui/anygui/test/test_aboutdlg.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** test_aboutdlg.py 13 Nov 2002 17:19:22 -0000 1.1 --- test_aboutdlg.py 16 Nov 2002 12:41:11 -0000 1.2 *************** *** 2,6 **** app = Application() ! aboutAg = AboutAnyguiDlg() app.add(aboutAg) app.run() --- 2,6 ---- app = Application() ! aboutAg = AboutDialog() app.add(aboutAg) app.run() |