Brian Theado 20Jan2005 - Inspired by the wealth of Tcl/Tk games available at sdarchive and elsewhere, I wrote some code that can be used to browse and execute a bunch of applications all bundled together into a single starkit.
I bundled together over 60 games in a just over 2MB starkit that can be downloaded from http://tkoutline.sourceforge.net/tkgamepack.kit . Run the program and see a hierarchical list of Tcl/Tk games. Click on the game title to launch it. Click on the game's url to find more information. Add the title of a game to the command line and that game will be run directly.
Implementation details.
Way cool! I've wondered for a long time when someone would take the initiative on this ;) -jcw
LV So, if people come up with additional script only games, how would they go about requesting the code be added?
Brian Theado - putting a request here seems like a good start.
LV So each time I select a game, a new starkit will end up in the real world flat directory where the starkit resides? Is there no way to run the starkits from where they are in the bundle?
I tried to find out for myself, but I see this error when I try to run your starkit:
invalid command name "option" while executing "option add *Text.wikimarkup "wikilinks urls style" user" (procedure "openAppLauncherOutline" line 3) invoked from within "openAppLauncherOutline [file join $::starkit::topdir applauncher]" (procedure "applauncher" line 31) invoked from within "applauncher" invoked from within "if {[llength $argv] == 0} { applauncher } else { set nestedkit [lindex $argv 0] set nestedkitmain [glob -nocomplain [file join $starkit::t..." (file "/volws/lwv28/ldatae/WWW/tkgamepack.kit/applauncher.tcl" line 68) invoked from within "source $starkit::topdir/applauncher.tcl" (file "./tkgamepack.kit/main.tcl" line 3) invoked from within "source ./tkgamepack.kit/main.tcl" ("uplevel" body line 1) invoked from within "uplevel [list source [file join $self main.tcl]]"
The problem is that your application launcher program is missing that
package require Tk
that you mentioned having to add in a few games.
The reason your app is working is probably because you are using Windows. Unfortunately, this is one of the differences between Windows and non-Windows tclkits.
Brian Theado - Yep. Thanks for the report and I have added the package require Tk. Redownload and try again.
I guess I didn't explain the implementation well enough. It is a single file and stays a single file. All the games run from within the starkit.
NEM - I get an error on startup on Mac OS X:
bad event type or keysym "grave" while executing "event add <<ShowAllAtCurrent>> <Control-grave>" .... (procedure "mapKeysToEvents" line 5) ....
This may well be a Mac OS X/Wishkit specific bug.
LV Interesting - well, that appears to be a tkoutline bug in the outlinewidget code. It should be simple enough to add a new switch case for MacOS X. What other keys are missing on the MacOS keyboards?
Brian Theado - Thanks for the report. As a quick fix I just removed that key binding entirely--it is mostly irrelevant to this application. Please redownload and try again. I guess noone on MacOS X has tried using tkoutline for the past year :(. Or just not telling me about the problems they encounter.
I've had trouble with this one before. Originally I was binding to <Control-`>, but that only worked on windows and I added a conditional to use <Control-grave> if not on Windows. I guess I'll rethink this binding for the next release. I don't think I'm using any other exotic bindings that will cause problems.
PWQ 21 Jan 05, LV, while the application may be causing the error I would not class this an bug. This is yet another example of people destroying the platform independance feature of tcl by adding in native components. the grave key should be implemented on all platforms and just ignored (or remapped) on ones that don't support it.
There is an increasing tendency to make applications not work on anything other than windows because of these features.
jcw - Nah. Maybe when on Windows, people 1) simply forgot the other 5%, 2) know too little about *nix, 3) just postpone it, or 4) leave it to those 5% to deal with it...
MG It seems to me that having it do nothing or remapping it would cause more problems than it raising an error. At least that way it's clear what the problem is, and it can be worked around in a way that makes sense for the app using it, whereas whichever key it would be automatically mapped to could already be in use for something else. IMHO it's just something that needs to be clearly documented, so people who want to code cross-platform know to avoid it or work around it for non-Windows platforms.
Lars H: I'd say this "grave" problem goes beyond platform differences. On for example a Swedish keyboard (to my knowledge regardless of platform) the grave accent is <Shift-acute>. Furthermore this is a dead-key, which means keypresses do not register until one presses another key (e.g. <Shift-acute><a> would normally yield \u00E0 -- latin small letter a with grave). It doesn't make much sense for Tk to error out just because some key is missing; the number of possible keys far exceed the number of keys on common keybords, so you'll have to assume that the normal state of affairs is that lots of keys are missing. I suspect however that this area of Tk isn't all that heavily documented ...
LV Have you reported this problem on the MacTcl mailing list yet?
Felipe Voloch I am getting an error every time I launch a game saying "couldn't open setup.tcl, no such...". I get to the initial screen OK, but all games I've tried to launch give the same error. This is on a linux box. Thanks.
LV Here's my suggestion.
information about what distribution you are using, and what version of the tclkit you downloaded.
24jan05 jcw - The setup.tcl file error is probably caused by tclkit. I suspect that it's not able to launch at all on your linux system. Be sure to try both the static and the non-static versions of tclkit [L1 ].
Brian Theado - He says he is able to see the the initial screen, so another possibility is that his version of tclkit is too old. I recall a while back that tclkit had problems loading starkits in slave interpreters. I can't seem to access the starkit archives at http://www.equi4.com/mailman/listinfo/starkit (Mailman experienced a very low level failure and could not even generate a useful traceback for you. Please report this to the Mailman administrator at this site.) in order to figure out just how long ago that slave interpreter fix was.