|
Friday, May 10, 2002 |
codeEditor
The source code editor is another scripting triumph. I started it last Friday by simply copying the PythonCard textEditor sample, creating a simple component wrapper around the wxPython wxStyledTextCtrl, changing the component used from a TextArea to the new CodeEditor component, and in 15 minutes I had a syntax highlighting Python source code editor. wxStyledTextCtrl is in turn a wrapper around Neil Hodgson's open source Scintilla.
After a few more days of work, the editor does all the basic editing functions you would expect for a good Python source code editor, you can set all of the styles used, check the syntax of scripts, run scripts, file history, it has a built-in shell, and you can extend the editor by writing scripts in (surprise) Python (we're calling them Scriptlets). So the full object model and data of the editor is there to be programmed, just like a "real editor" such as Emacs. Not bad for around a 1000 lines of code and less than a weeks work. There is a codeEditor wiki page if you want more info on the editor.
Here's an example Scriptlet included with codeEditor, called appropriately enough insertDateAndTime.py import time now = time.localtime(time.time()) dateStr = time.strftime("%A, %B %d, %Y, %I:%M %p", now) comp.document.ReplaceSelection(dateStr)
Here's a shot of the codeEditor editing itself.
8:31:19 AM
|
|
PythonCard 0.6.6
PythonCard is a GUI construction kit for building cross-platform desktop applications on Windows, Mac OS X, and Linux. The latest release of PythonCard includes 30 sample applications, new additions include a Python source code editor and a sample for creating flat file databases. This release also supports the new wxPython 2.3.3 preview for Mac OS X.
The documentation page has links to installation instructions for Windows that covers installing Python, wxPython, and PythonCard. There is a new set of Wiki pages for "in progress" documentation and to supplement the main web site. Check the changelog for a complete list of changes for release 0.6.6.
7:44:13 AM
|
|
© Copyright 2002 Kevin Altis.
|
|
|
|
|
|
May 2002 |
Sun |
Mon |
Tue |
Wed |
Thu |
Fri |
Sat |
|
|
|
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
|
Apr Jun |
|
|
|
|
|
|