Updated 2015-05-27 13:11:02 by wdb

Summary  edit

Tiny Tcl/Tk-IDE is minimalist IDE written in pure Tcl/Tk, optimised only for Tcl/Tk, quick'n' easy

Attributes  edit


Features  edit

  • syntax hilight -- see screenshot above
  • search/replace of regular expressions also in replace field, see screenshot below
  • double-click, see above
  • Tab key on start of line invokes smart indent
  • bookmarks
  • directory window provides preview of procs in closed docs
  • keywords (method, proc ...) are hideable as well as namespace paths in directory window
  • command-line provides quick test,
  • send regions from text window directly to console window.

Moreover  edit

These features are packaged such that they can be used separately (feel free to test them):
the main command is syntaxhighlight::highlight win
changes Text bindings, see above
provides smart indent on Tab key
text widget with scrollbars
provides double-window with directory and file contents
provides tiny console, not as top-level but as frame

Being optimised to easy overview on a project, this tool should be usable for a beginner.

Response  edit

[Lectus]: Nice work! I really like this IDE!

Obtaining  edit


Description  edit

wdb As an Emacs fan, here are the features I like mostly:

  • double-click on opening paren selects complete expr
  • speedbar shows procs and methods
  • command line allows quick tests

I submitted a question concerning how to customize Emacs to accept not only procs but also self-defined xprocs etc, but I got no answer. The solution of learning Elisp would take me more time than to make a new environment in Tcl/Tk.

Written in pure Tcl/Tk such that you are not stuck to some special OO extension etc. Documentation (Beta) included: [1].

Highlighting  edit

Hilight of first word in line as command always bold,

but if it is a $string, then fg color inherited by strings (maroon fg), and if it is a [proc call], then fg color is inherited by proc calls (red fg). In general, it is more consistent than any regexp-driven solution I can imagine. (But of course, everyday there can come a wizard who solves that, too ...) Problem: casually watched that app hangs. Cannot say if it depends on Hilight or not. Must watch. Problem reports appreciated.

The Hilight deals only with the Endekalogue, i.e. the procedure if is recognized by its first position on command line, but the keyword else is not recognized as it is just another pure-string argument to an arbitrary procedure. Completely spoken: Tcl has no keywords.


This syntax hilight recognizes {expand} constructions {*}...


More on the GUI of syntax hilight: if you open a file which is very large, then you can edit it immediately, but it can take several seconds before you see the syntax hilighting as it is bound to after idle event. This idea is stolen from MS Frontpage (which I do not like very much, but honour to those who honour deserve).

Anticro's Version  edit

Anticro (member of German Tcl/Tk forum) reported problems displaying paned windows on Apple computers. He allowed me to use his GUI for an alternative version of Tiny Tcl/Tk IDE. See screenshot. It is an alternative. The download contains two GUIs (IDE.tcl and niceIDE.tcl) but only one core (inside lib/ located). Anticro deserves a hip-hip-hooray.

Change Log  edit


Hilight of [proc call] more precise.

wdb: Latest update -- code folding (not a big thing, just hidden with tag option -elide). Done with context menu "hide" and "show".

Misc  edit

rgf 2007-05-22: To run this under linux with tclkit 8.4 I needed to comment out line 15 "namespace import speedbar::speedbar" ... apparently this is already done by the package?

wdb: Yes it is.

Some style guides say about delivering packages: do not pollute root namespace by importing your commands. But, formally seen, speedbar is constructor of a mega-widget, and I put it to the root namespace as well as constructors of core widgets.

The double call of namespace import speedbar::speedbar is now removed.

escargo 2005-05-29:

It was probably unintentional, but the latest packaging of the IDE.zip file included the emacs backup files for IDE.tcl and syntaxhighlight.tcl. While instructive in a way, they add another 23K (uncompressed to the zip file). (And the backup file shows that the new IDE.tcl file has added even more blank lines to the bottom of the file.)

wdb: Thanks for the hint, I'll care better in future. Currently, I work with Ubuntu/Nautilus where system files are hidden if I do not unhide them intentionally (which is rarely the case).

escargo 2007-06-01: I noticed that the IDE apparently is trying to show the cursor position. However, I observed that while the number changes as I point and click, it does not seem to change when I use the keyboard arrow keys to move the cursor around.

wdb: This bug is on my to-do list. Dealing with priority of events is sometimes dangerous, a little bit :-(

escargo: It's not a big deal; I'm not even sure I would count it as a bug. emacs has a key sequence that can be used to ask where the cursor is. Maybe a keyboard shortcut to update the cursor position would be enough. wdb The problem is: Update of row/col is bound to <<Change>>. It consists of <Key> and <Button>. But if Syntax Hilight is on, then event <Key> triggers something such that it hides the <<Change>> event. I'll solve it. wdb A few hours later (at home): done. But, I agree, it was not prio 1. The main reason for my efforts were: I had some new idea, and after the solution, the script is simpler.

wdb 2009-06-19: contained package doubleclick modifies tk-internal procedures of text selection. These procedures change when switching from Tcl 8.4 to 8.5 so I modified the changed procedures anew. If you use this IDE with Tcl 8.4, then package doubleclick is caught, but you can continue working.

Note that eTcl text selection procedure differs from "regular" Tcl distribution. If you want to use this IDE with eTcl, comment out the line "catch {package require doubleclick}".

jmr 2009-10-01 14:21:20:

I like the ide, but heres a problem.

How to decouple the preferences.txt? Can this be split up some? One problem is if you move the ide folder around it loads the prefs and then its on the wrong disk and fails. Not good if the purpose is to provide a editor with a project that does move around and is used by different developers on different machines.

I have attempted this but its deeply embedded so I've not done it successfully. Thanks!