= Wax = Report written by LionKimbro, on <>. 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 == * Blog: http://zephyrfalcon.org/weblog/arch_Wax.html * Static Information: http://zephyrfalcon.org/labs/dope_on_wax.html * Wiki: http://zephyrfalcon.org/moin.cgi * Downloads: http://zephyrfalcon.org/download/ * Primer: http://zephyrfalcon.org/labs/wax_primer.html 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: http://zephyrfalcon.org/weblog/index.html Blog has moved here: http://zephyrfalcon.org/weblog2/ == Status == As of <> (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:]] {{{ #!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() }}}