Size: 1437
Comment: missing edit-log entry for this revision
|
Size: 4124
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 3: | Line 3: |
Report written by LionKimbro, on [[Date(2003-09-20T12:45:16)]]. Please update and correct where I have made omissions. I have not yet downloaded and applied Wax. | Report written by LionKimbro, on [[Date(2003-09-20T12:45:16)]]. Please correct errors & omissions. I have not yet downloaded and applied Wax. Updated a little by Joanna on 13 November 2004. I distribute a project (http://www.cs.bath.ac.uk/~jjb/web/pyposh.html) one of my students used wax in. When/if Wax has more web presence, please completely rewrite this page. |
Line 11: | Line 15: |
* Wiki: (None Yet) | * Wiki: http://zephyrfalcon.org/moin.cgi |
Line 13: | Line 17: |
* Primer: http://zephyrfalcon.org/labs/wax_primer.html | |
Line 22: | Line 27: |
* Name: Hans Nowak | * Name: HansNowak |
Line 24: | Line 29: |
Blog has moved here: http://zephyrfalcon.org/weblog2/ |
|
Line 27: | Line 34: |
At of [[Date(2003-09-20T12:45:16)]]: | As of [[Date(2003-09-20T12:45:16)]] (with Nov 04 updates): |
Line 31: | Line 38: |
Judging by the blog, the author seems to have worked on Wax in May (5), August (8), and September (9), of 2003, indicating continuing development. | Judging by the blog, the author seems to have worked on Wax in May (5), August (8), and September (9), of 2003, indicating continuing development. The downloads page actually has more versions (and more recent versions) than the blog indicates. Current most recent is September 2004. Blog indicates development is to keep up with new versions of wxPython. |
Line 34: | Line 41: |
== Sample Code == Copied from [http://zephyrfalcon.org/labs/wax_primer.html part 1 of the Wax Primer:] {{{ #!python from wax import * FIXED_FONT = Font('Courier New', 10) class MainFrame(Frame): def Body(self): self.filename = None self.CreateMenu() self.textbox = TextBox(self, multiline=1, wrap=0) self.textbox.SetFont(FIXED_FONT) self.AddComponent(self.textbox) def CreateMenu(self): menubar = MenuBar() menu1 = Menu(self) menu1.Append("&New", self.New, "Create a new file") menu1.Append("&Open", self.Open, "Open a file") menu1.Append("&Save", self.Save, "Save a file") menubar.Append(menu1, "&File") self.SetMenuBar(menubar) def New(self, event): self.textbox.Clear() self.filename = None def Open(self, event): dlg = FileDialog(self, open=1) try: result = dlg.ShowModal() if result == 'ok': filename = dlg.GetPaths()[0] self._OpenFile(filename) finally: dlg.Destroy() def _OpenFile(self, filename): self.filename = filename f = open(filename, 'r') data = f.read() f.close() self.textbox.Clear() self.textbox.AppendText(data) def Save(self, event): if self.filename: self._SaveFile(self.filename) else: dlg = FileDialog(self, save=1) try: result = dlg.ShowModal() if result == 'ok': filename = dlg.GetPaths()[0] self.filename = filename self._SaveFile(filename) finally: dlg.Destroy() def _SaveFile(self, filename): f = open(filename, 'w') f.write(self.textbox.GetValue()) f.close() app = Application(MainFrame, title="A simple editor") app.Run() }}} |
Wax
Report written by LionKimbro, on Date(2003-09-20T12:45:16). Please correct errors & omissions. I have not yet downloaded and applied Wax.
Updated a little by Joanna on 13 November 2004. I distribute a project (http://www.cs.bath.ac.uk/~jjb/web/pyposh.html) one of my students used wax in.
When/if Wax has more web presence, please completely rewrite this page.
Project Summary
Static Information: http://zephyrfalcon.org/labs/dope_on_wax.html
Downloads: http://zephyrfalcon.org/download/
Wax is a friendly layer atop wxPython.
RobinDunn is trying to keep wxPython close to wxWindows, but believes there is room for a layer on top, to make wxPython more python-ic.
Wax appears to be trying to fit that role.
Project Author
Name: HansNowak
Blog has moved here: http://zephyrfalcon.org/weblog2/
Status
As of Date(2003-09-20T12:45:16) (with Nov 04 updates):
Wax does not appear to be documented, however, there are a lot of sample snips on [http://zephyrfalcon.org/weblog/arch_Wax.html the blog.]
Judging by the blog, the author seems to have worked on Wax in May (5), August (8), and September (9), of 2003, indicating continuing development. The downloads page actually has more versions (and more recent versions) than the blog indicates. Current most recent is September 2004. Blog indicates development is to keep up with new versions of wxPython.
KevinAltis has posted to the blog, indicating that there's some awareness in the wxPython community of wax. However, this is the first entry on this wiki about it. There are [http://aspn.activestate.com/ASPN/search?query=wax&x=0&y=0&type=Archive_wxPython-users_list no entries in the wxPython-users mailing list] to date about it either.
Sample Code
Copied from [http://zephyrfalcon.org/labs/wax_primer.html part 1 of the Wax Primer:]
1 from wax import *
2
3 FIXED_FONT = Font('Courier New', 10)
4
5 class MainFrame(Frame):
6
7 def Body(self):
8 self.filename = None
9 self.CreateMenu()
10 self.textbox = TextBox(self, multiline=1, wrap=0)
11 self.textbox.SetFont(FIXED_FONT)
12 self.AddComponent(self.textbox)
13
14 def CreateMenu(self):
15 menubar = MenuBar()
16
17 menu1 = Menu(self)
18 menu1.Append("&New", self.New, "Create a new file")
19 menu1.Append("&Open", self.Open, "Open a file")
20 menu1.Append("&Save", self.Save, "Save a file")
21
22 menubar.Append(menu1, "&File")
23
24 self.SetMenuBar(menubar)
25
26 def New(self, event):
27 self.textbox.Clear()
28 self.filename = None
29
30 def Open(self, event):
31 dlg = FileDialog(self, open=1)
32 try:
33 result = dlg.ShowModal()
34 if result == 'ok':
35 filename = dlg.GetPaths()[0]
36 self._OpenFile(filename)
37 finally:
38 dlg.Destroy()
39
40 def _OpenFile(self, filename):
41 self.filename = filename
42 f = open(filename, 'r')
43 data = f.read()
44 f.close()
45 self.textbox.Clear()
46 self.textbox.AppendText(data)
47
48 def Save(self, event):
49 if self.filename:
50 self._SaveFile(self.filename)
51 else:
52 dlg = FileDialog(self, save=1)
53 try:
54 result = dlg.ShowModal()
55 if result == 'ok':
56 filename = dlg.GetPaths()[0]
57 self.filename = filename
58 self._SaveFile(filename)
59 finally:
60 dlg.Destroy()
61
62 def _SaveFile(self, filename):
63 f = open(filename, 'w')
64 f.write(self.textbox.GetValue())
65 f.close()
66
67 app = Application(MainFrame, title="A simple editor")
68 app.Run()