proc hello {} { puts "Hello Tcl/Tk!" } button ".b" -text "Say Hello" -command hello pack ".b" -padx 20 -pady 6 #include "cpptk.h" #include <stdio.h> using namespace Tk; void hello() { puts("Hello C++/Tk!"); } int main(int, char *argv[]) { init(argv[0]); button(".b") -text("Say Hello") -command(hello); pack(".b") -padx(20) -pady(6); runEventLoop(); } Apart from the scaffolding necessary in C++, bot
Still using the first edition, second edition or third edition? Follow these links for errata for those editions. Feel free to email detailed comments to me at welch@acm.org and put the word "book" into the subject. I have put a few responses up on the web. See what folks are saying about the book. The book comes with a CD-ROM that has all the examples in the book, plus a variety of Tcl/Tk freewar
STk is a free R4RS Scheme interpreter which can access the Tk graphical package. Concretely, it can be seen as the standard Tk package where Tcl has been replaced by a Scheme interpreter. STk embeds also an efficient CLOS like object oriented system, called STklos, which provides: multiple inheritance, generic functions, multi-methods, a MOP (Meta Object Protocol) STklos MOP is based on the Tiny C
第13回はTcl/Tkを使ってみましょう。Tcl/Tkは、スクリプト言語のTclと、そのGUI拡張であるTkとによって構成されています。まずはTclのみを使ったHello Worldを作成し、その後Tcl/TkのGUIのHello Worldを作成していきます。 Tclのputsを使う方法 リスト1は、Tclのputsを使ったHello Worldです。このようにTclスクリプトでは、インタプリタとしてtclshを使います。putsでは、改行は自動的に付加されます。Tclの文字列は、{ }またはダブルクォートで囲みます。ダブルクォートの場合は\nなどのエスケープ文字が解釈されますが、{ }の場合はそのままの文字列と解釈されます。 リスト1 Tclのputsを使う(tcl_puts) #!/usr/bin/tclsh ← Tclのインタプリタであるtclshを指定 puts {Hello W
John Ousterhout の作った言語 Tcl/Tk は、非常に便利な言語である。これは簡単なスクリプト言語の側面と、GUIツールキットの二面性を持ち、そのために多彩な理用法が可能である。ここで、筆者が経験した多様な使い方を紹介し、Tck/Tk の有効性について議論しよう。やや未完成なかたちで公開するが、それでも有益だろう。そのうち追加するので待っていて欲しい。 済まぬが量がちょっと異常になってしまった。それゆえ前編・後編と分けて記述する。続けて読まれたい。 前編 Tcl/Tk とは Tcl/Tk アプリケーション MVCデザイン C言語プログラムから Tcl/Tk スクリプトを生成してGUIを実現する タートルグラフィックス用インタプリタ NEW!!! C言語によって自前コマンドを処理できるインタプリタを作成する! 後編 C言語によって自前の Tk ウィジットを新たに作る! C言語
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く