1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* renewal Ruby/Tk

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagai 2004-05-01 16:09:54 +00:00
parent 9857d6c546
commit f1c3638777
132 changed files with 7836 additions and 11515 deletions

View file

@ -1,3 +1,7 @@
Sun May 2 01:04:38 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tcltklib, ext/tk: renewal Ruby/Tk
Fri Apr 30 20:08:41 2004 WATANABE Hirofumi <eban@ruby-lang.org>
* time.c (SIZEOF_TIME_T): support SIZEOF_TIME_T == SIZEOF_INT.

View file

@ -11,6 +11,8 @@ lib/tcltk.rb
demo/lines0.tcl
demo/lines1.rb
demo/lines2.rb
demo/lines3.rb
demo/lines4.rb
demo/safeTk.rb
sample/sample0.rb
sample/sample1.rb

View file

@ -1,5 +1,5 @@
(tof)
2003/10/17 Hidetoshi NAGAI
2004/03/28 Hidetoshi NAGAI
This document discribes about the 'tcltklib' library. Although there
is the 'tcltk' library (tcltk.rb) under this directory, no description
@ -41,224 +41,367 @@ module TclTklib
: a target event. With this flag, doesn't wait and returns
: false if there is no target event for processing.
[module methods]
mainloop(check_root = true)
: Starts the eventloop. If 'check_root' is true, this method
: doesn't return when a root widget exists.
: If 'check_root' is false, doen't return by the other
: reasons than exceptions.
module TclTkLib::VarAccessFlag
: Defines flags to give '_get_variable' and so on. When to give,
: please use bit-operator (e.g. GLOBAL_ONLY | LEAVE_ERR_MSG ).
mainloop_watchdog(check_root = true)
: On the normal eventloop, some kinds of callback operations
: cause deadlock. To avoid some of such deadlocks, this
: method starts an eventloop and a watchdog-thread.
[constants]
NONE
: Is 0. It means "set no flag".
do_one_event(flag = TclTkLib::EventFlag::ALL |
TclTkLib::EventFlag::DONT_WAIT)
: Do one event for processing. When processed an event,
: returns true.
: If NOT set DONT_WAIT flag, this method waits occurrence of
: a target event.
: If set DONT_WAIT flag and no event for processing, returns
: false immediately.
: If $SAFE >= 4, or $SAFE >= 1 and the flag is tainted,
: force to set DONT_WAIT flag.
GLOBAL_ONLY
: (site Tcl/Tk's man page)
: Under normal circumstances the procedures look up
: variables as follows: If a procedure call is active
: in interp, a variable is looked up at the current
: level of procedure call. Otherwise, a variable is
: looked up first in the current namespace, then in
: the global namespace. However, if this bit is set
: in flags then the variable is looked up only in the
: global namespace even if there is a procedure call
: active. If both GLOBAL_ONLY and NAMESPACE_ONLY are
: given, GLOBAL_ONLY is ignored.
:
: *** ATTENTION ***
: Tcl7.6 doesn't have namespaces. So NAMESPACE_ONLY
: is defined as 0, and then GLOBAL_ONLY is available
: even if flag is (GLOBAL_ONLY | NAMESPACE_ONLY).
set_eventloop_tick(timer_tick)
: Define the interval of thread-switching with an integer
: value of mili-seconds.
: Default timer_tick is 0. It means that thread-switching
: is based on the count of processed events.
: ( see 'set_eventloop_weight' method )
: However, if the eventloop thread is the only thread,
: timer_tick cannt be set to 0. If 0, then is set to 100 ms
: automatically (see NO_THREAD_INTERRUPT_TIME on tcltklib.c).
: On $SAFE >= 4, cannot call this method.
NAMESPACE_ONLY
: (site Tcl/Tk's man page)
: Under normal circumstances the procedures look up
: variables as follows: If a procedure call is active
: in interp, a variable is looked up at the current
: level of procedure call. Otherwise, a variable is
: looked up first in the current namespace, then in
: the global namespace. However, if this bit is set
: in flags then the variable is looked up only in the
: current namespace even if there is a procedure call
: active.
:
: *** ATTENTION ***
: Tcl7.6 doesn't have namespaces. So NAMESPACE_ONLY
: is defined as 0.
get_eventloop_tick
: Get current value of 'timer_tick'
LEAVE_ERR_MSG
: (site Tcl/Tk's man page)
: If an error is returned and this bit is set in flags,
: then an error message will be left in the interpreter's
: result, where it can be retrieved with Tcl_GetObjResult
: or Tcl_GetStringResult. If this flag bit isn't set then
: no error message is left and the interpreter's result
: will not be modified.
set_no_event_wait(no_event_wait)
: Define sleeping time of the eventloop when two or more
: thread are running and there is no event for processing.
: Default value is 20 (ms).
: If the eventloop thread is the only thread, this value is
: invalid.
: On $SAFE >= 4, cannot call this method.
APPEND_VALUE
: (site Tcl/Tk's man page)
: If this bit is set then newValue is appended to the
: current value, instead of replacing it. If the variable
: is currently undefined, then this bit is ignored.
get_no_event_wait
: Get current value of 'no_event_wait'.
LIST_ELEMENT
: (site Tcl/Tk's man page)
: If this bit is set, then newValue is converted to a
: valid Tcl list element before setting (or appending
: to) the variable. A separator space is appended before
: the new list element unless the list element is going
: to be the first element in a list or sublist (i.e. the
: variable's current value is empty, or contains the
: single character ``{'', or ends in `` }'').
set_eventloop_weight(loop_max, no_event_tick)
: Define the weight parameters for the eventloop thread.
: That is invalid when the eventloop is the only thread.
: 'loop_max' is the max events for thread-switching.
: 'no_event_tick' is the increment value of the event count
: when no event for processing (And then, the eventloop thead
: sleeps 'no_event_wait' mili-seconds).
: 'loop_max == 800' and 'no_event_tick == 10' are defalut.
: On $SAFE >= 4, cannot call this method.
PARSE_VARNAME
: (site Tcl/Tk's man page)
: If this bit is set when calling _set_variable and so
: on, var_name argument may contain both an array and an
: element name: if the name contains an open parenthesis
: and ends with a close parenthesis, then the value
: between the parentheses is treated as an element name
: (which can have any string value) and the characters
: before the first open parenthesis are treated as the
: name of an array variable. If the flag PARSE_VARNAME
: is given, index_name argument should be 'nil' since the
: array and element names are taken from var_name.
:
: *** ATTENTION ***
: Tcl7.6 doesn't have this flag. So PARSE_VARNAME is
: defined as 0.
get_eventloop_weight
: Get current values of 'loop_max' and 'no_event_tick'.
[module methods]
mainloop(check_root = true)
: Starts the eventloop. If 'check_root' is true, this method
: doesn't return when a root widget exists.
: If 'check_root' is false, doen't return by the other
: reasons than exceptions.
mainloop_abort_on_exception=(bool)
: Define whether the eventloop stops on exception or not.
: If true (default value), stops on exception.
: If false, show a warinig message but ignore the exception.
: If nil, no warning message and ignore the excepsion.
: This parameter is sometimes useful when multiple Tk
: interpreters are working. Because the only one eventloop
: admins all Tk interpreters, sometimes exception on a
: interpreter kills the eventloop thread. Even if such
: situation, when abort_on_exception == false or nil,
: the eventloop ignores the exception and continue to working.
: On $SAFE >= 4, cannot call this method.
mainloop_watchdog(check_root = true)
: On the normal eventloop, some kinds of callback operations
: cause deadlock. To avoid some of such deadlocks, this
: method starts an eventloop and a watchdog-thread.
mainloop_abort_on_exception
: Get current status of that.
do_one_event(flag = TclTkLib::EventFlag::ALL |
TclTkLib::EventFlag::DONT_WAIT)
: Do one event for processing. When processed an event,
: returns true.
: If NOT set DONT_WAIT flag, this method waits occurrence of
: a target event.
: If set DONT_WAIT flag and no event for processing, returns
: false immediately.
: If $SAFE >= 4, or $SAFE >= 1 and the flag is tainted,
: force to set DONT_WAIT flag.
num_of_mainwindows
: Returns the number of main-windows (root-widget).
: Because there is only one main-window for one Tk interpreter,
: the value is same to the number of interpreters which has
: available Tk functions.
set_eventloop_tick(timer_tick)
: Define the interval of thread-switching with an integer
: value of mili-seconds.
: Default timer_tick is 0. It means that thread-switching
: is based on the count of processed events.
: ( see 'set_eventloop_weight' method )
: However, if the eventloop thread is the only thread,
: timer_tick cannt be set to 0. If 0, then is set to 100 ms
: automatically (see NO_THREAD_INTERRUPT_TIME on tcltklib.c).
: On $SAFE >= 4, cannot call this method.
get_eventloop_tick
: Get current value of 'timer_tick'
set_no_event_wait(no_event_wait)
: Define sleeping time of the eventloop when two or more
: thread are running and there is no event for processing.
: Default value is 20 (ms).
: If the eventloop thread is the only thread, this value is
: invalid.
: On $SAFE >= 4, cannot call this method.
get_no_event_wait
: Get current value of 'no_event_wait'.
set_eventloop_weight(loop_max, no_event_tick)
: Define the weight parameters for the eventloop thread.
: That is invalid when the eventloop is the only thread.
: 'loop_max' is the max events for thread-switching.
: 'no_event_tick' is the increment value of the event count
: when no event for processing (And then, the eventloop thead
: sleeps 'no_event_wait' mili-seconds).
: 'loop_max == 800' and 'no_event_tick == 10' are defalut.
: On $SAFE >= 4, cannot call this method.
get_eventloop_weight
: Get current values of 'loop_max' and 'no_event_tick'.
mainloop_abort_on_exception=(bool)
: Define whether the eventloop stops on exception or not.
: If true (default value), stops on exception.
: If false, show a warinig message but ignore the exception.
: If nil, no warning message and ignore the excepsion.
: This parameter is sometimes useful when multiple Tk
: interpreters are working. Because the only one eventloop
: admins all Tk interpreters, sometimes exception on a
: interpreter kills the eventloop thread. Even if such
: situation, when abort_on_exception == false or nil,
: the eventloop ignores the exception and continue to working.
: On $SAFE >= 4, cannot call this method.
mainloop_abort_on_exception
: Get current status of that.
num_of_mainwindows
: Returns the number of main-windows (root-widget).
: Because there is only one main-window for one Tk interpreter,
: the value is same to the number of interpreters which has
: available Tk functions.
_merge_tklist(str, str, ... )
: Get a Tcl's list string from arguments with a Tcl/Tk's
: library function. Each arguemnt is converted to a valid
: Tcl list element.
_conv_listelement(str)
: Convert the argument to a valid Tcl list element with
: Tcl/Tk's library function.
_toUTF8(str, encoding)
_fromUTF8(str, encoding)
: Call the function (which is internal function of Tcl/Tk) to
: convert to/from a UTF8 string.
_subst_UTF_backslash(str)
_subst_Tcl_backslash(str)
: Substitute backslash sequence with Tcl's rule (include \uhhhh;
: give a sixteen-bit hexadecimal value for Unicode character).
: _subst_Tcl_backslash method parses all backslash sequence.
: _subst_UTF_backslash method parses \uhhhh only.
class TclTkIp
[class methods]
new(ip_name=nil, options='')
: Generate an instance of TclTkIp class.
: If 'ip_name' argument is given as a string, it is the name
: of the Tk interpreter which is shown by 'winfo interps'
: command.
: 'options' argument accepts a string which is the command
: line options of wish; such as '-geometry' or '-use'.
: The information is used to generate the root widget of the
: interpreter.
: ( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') )
: If is given nil or falsr for the 'option' argument, generates
: the Tcl interpreter without Tk library. Then the interpreter
: doesn't need GUI environment. Therefore, even if a window
: system doesn't exist or cannot be used, Ruby can control the
: Tcl interpreter and the extention libraries loaded on the
: interpreter.
new(ip_name=nil, options='')
: Generate an instance of TclTkIp class.
: If 'ip_name' argument is given as a string, it is the name
: of the Tk interpreter which is shown by 'winfo interps'
: command.
: 'options' argument accepts a string which is the command
: line options of wish; such as '-geometry' or '-use'.
: The information is used to generate the root widget of the
: interpreter.
: ( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') )
: If is given nil or falsr for the 'option' argument, generates
: the Tcl interpreter without Tk library. Then the interpreter
: doesn't need GUI environment. Therefore, even if a window
: system doesn't exist or cannot be used, Ruby can control the
: Tcl interpreter and the extention libraries loaded on the
: interpreter.
[instance methods]
create_slave(name, safe=false)
: Create a slave interpreter.
: The parent of the interpreter is the receiver of this method.
: The name of the slave interpreter is given by 'name' argument.
: The 'safe' argument decides whether the slave interpreter is
: created as a safe interpreter or not. If true, create a safe
: interpreter. Default is false. However, if the parent
: interpreter is a safe interpreter, the created interpreter is
: a safe interpreter (ignore 'safe' argument value).
: If $SAFE >= 4, can create a safe interpreter only.
[instance methods]
create_slave(name, safe=false)
: Create a slave interpreter.
: The parent of the interpreter is the receiver of this method.
: The name of the slave interpreter is given by 'name' argument.
: The 'safe' argument decides whether the slave interpreter is
: created as a safe interpreter or not. If true, create a safe
: interpreter. Default is false. However, if the parent
: interpreter is a safe interpreter, the created interpreter is
: a safe interpreter (ignore 'safe' argument value).
: If $SAFE >= 4, can create a safe interpreter only.
make_safe
: Make the interpreter to the safe interpreter, and returns
: self. If fail, raise RuntimeError.
make_safe
: Make the interpreter to the safe interpreter, and returns
: self. If fail, raise RuntimeError.
safe?
: Check whether the interpreter is the safe interpreter.
: If is the safe interpreter, returns true.
safe?
: Check whether the interpreter is the safe interpreter.
: If is the safe interpreter, returns true.
delete
: Delete the interpreter.
: The deleted interpreter doesn't accept command and then
: raise an exception.
delete
: Delete the interpreter.
: The deleted interpreter doesn't accept command and then
: raise an exception.
deleted?
: Check whether the interpreter is already deleted.
: If deleted, returns true.
deleted?
: Check whether the interpreter is already deleted.
: If deleted, returns true.
restart
: Restart Tk part of the interpreter.
: Use this when you need Tk functions after destroying the
: root widget.
: On $SAFE >= 4, cannot call this method.
restart
: Restart Tk part of the interpreter.
: Use this when you need Tk functions after destroying the
: root widget.
: On $SAFE >= 4, cannot call this method.
_eval(str)
_invoke(*args)
: Estimates the arguments as a command on the Tk interpreter.
: The argument of _eval is a script of Tcl/Tk.
: Each argument of _invoke is a token of one command line of
: Tcl/Tk.
: Because the operation of _invoke doesn't through the
: command line parser of Tk interpreter, the cost of
: estimation is smaller than _eval. However, auto_load
: mechanism of the Tk interpreter doesn't work on _invoke.
: So _invoke can call only the command which already
: registered on the interpreter by 'load' command and so on.
: On _eval command, auto_load mechanism words. So if succeed
: to _eval and regist the command once, after that, the
: command can be called by _invoke.
_eval(str)
_invoke(*args)
: Estimates the arguments as a command on the Tk interpreter.
: The argument of _eval is a script of Tcl/Tk.
: Each argument of _invoke is a token of one command line of
: Tcl/Tk.
: Because the operation of _invoke doesn't through the
: command line parser of Tk interpreter, the cost of
: estimation is smaller than _eval. However, auto_load
: mechanism of the Tk interpreter doesn't work on _invoke.
: So _invoke can call only the command which already
: registered on the interpreter by 'load' command and so on.
: On _eval command, auto_load mechanism words. So if succeed
: to _eval and regist the command once, after that, the
: command can be called by _invoke.
_toUTF8(str, encoding)
_fromUTF8(str, encoding)
: Call the function (which is internal function of Tcl/Tk) to
: convert to/from a UTF8 string.
_toUTF8(str, encoding)
_fromUTF8(str, encoding)
: Call the function (which is internal function of Tcl/Tk) to
: convert to/from a UTF8 string.
_thread_vwait(var_name)
_thread_tkwait(mode, target)
: 'vwait' or 'tkwait' with thread support.
: The difference from normal 'vwait' or 'tkwait' command is
: doing independent wait from the vwait stack when they are
: called on the other thread than the eventloop thread.
: In the case of Tcl/Tk's vwait / tkwait, if 2nd vwait /
: tkwait is called on waiting for 1st vwait / tkwait,
: returns the order of [2nd]->[1st] regardless of the order
: of when the wait condition was fulfilled.
: If _thread_vwait / _thread_tkwait is called on the
: eventloop thread, there is no difference from vwait /
: tkwait. But if called on the other thread than the
: eventloop, stops the thread. And when the wait condition
: is fulfilled, the thread restarts. The meaning of
: "independent from the vwait stack" is that the timing of
: restarting is independent from the waiting status of the
: other threads. That is, even if the eventloop thread is
: waiting by vwait and is not fulfilled the condition,
: _thread_vwait completes the waiting when its waiting
: condition is fulfilled and the thread which stopped by
: _thread_vwait can continue the operation.
_thread_vwait(var_name)
_thread_tkwait(mode, target)
: 'vwait' or 'tkwait' with thread support.
: The difference from normal 'vwait' or 'tkwait' command is
: doing independent wait from the vwait stack when they are
: called on the other thread than the eventloop thread.
: In the case of Tcl/Tk's vwait / tkwait, if 2nd vwait /
: tkwait is called on waiting for 1st vwait / tkwait,
: returns the order of [2nd]->[1st] regardless of the order
: of when the wait condition was fulfilled.
: If _thread_vwait / _thread_tkwait is called on the
: eventloop thread, there is no difference from vwait /
: tkwait. But if called on the other thread than the
: eventloop, stops the thread. And when the wait condition
: is fulfilled, the thread restarts. The meaning of
: "independent from the vwait stack" is that the timing of
: restarting is independent from the waiting status of the
: other threads. That is, even if the eventloop thread is
: waiting by vwait and is not fulfilled the condition,
: _thread_vwait completes the waiting when its waiting
: condition is fulfilled and the thread which stopped by
: _thread_vwait can continue the operation.
_return_value
: Get the last result value on the interpreter.
_return_value
: Get the last result value on the interpreter.
mainloop
mainloop_watchdog
: If on the slave interpreter, never start an eventloop and
: returns nil.
: With the exception that, same to the TclTkLib module method
: with the same name.
_get_variable(var_name, flag)
_get_variable2(var_name, index_name, flag)
: Get the current value of a variable. If specified a
: index_name (see also the PARSE_VARNAME flag), get the
: value of the index_name element.
do_one_event
: With the exception that the argument is forced to set
: DONT_WAIT flag on the slave interpreter, same to
: TclTkLib#do_one_event.
_set_variable(var_name, value, flag)
_set_variable2(var_name, index_name, value, flag)
: Create or modify a variable. If specified a index_name
: (see also the PARSE_VARNAME flag), create or modify the
: index_name element.
set_eventloop_tick
get_eventloop_tick
set_no_event_wait
get_no_event_wait
set_eventloop_weight
get_eventloop_weight
mainloop_abort_on_exception
mainloop_abort_on_exception=
: With the exception that it is ignored to set value on the
: slave interpreter, same to the TclTkLib module method with
: the same name.
_unset_variable(var_name)
_unset_variable2(var_name, index_name)
: Remove a variable. If specified a index_name (see also
: the PARSE_VARNAME flag), remove the index_name element.
_get_global_var(var_name)
_get_global_var2(var_name, index_name)
_set_global_var(var_name, value)
_set_global_var2(var_name, index_name, value)
_unset_global_var(var_name)
_unset_global_var2(var_name, index_name)
: Call the associated method with the flag argument
: (GLOBAL_ONLY | LEAVE_ERR_MSG).
_split_tklist(str)
: Split the argument with Tcl/Tk's library function and
: get an array as a list of Tcl list elements.
_merge_tklist(str, str, ... )
: Get a Tcl's list string from arguments with a Tcl/Tk's
: library function. Each arguemnt is converted to a valid
: Tcl list element.
_conv_listelement(str)
: Convert the argument to a valid Tcl list element with
: Tcl/Tk's library function.
mainloop
mainloop_watchdog
: If on the slave interpreter, never start an eventloop and
: returns nil.
: With the exception that, same to the TclTkLib module method
: with the same name.
do_one_event
: With the exception that the argument is forced to set
: DONT_WAIT flag on the slave interpreter, same to
: TclTkLib#do_one_event.
set_eventloop_tick
get_eventloop_tick
set_no_event_wait
get_no_event_wait
set_eventloop_weight
get_eventloop_weight
mainloop_abort_on_exception
mainloop_abort_on_exception=
: With the exception that it is ignored to set value on the
: slave interpreter, same to the TclTkLib module method with
: the same name.
class TkCallbackBreak < StandardError
class TkCallbackContinue < StandardError
: They are exception classes to break or continue the Tk callback
: operation.
: If raise TkCallbackBreak on the callback procedure, Ruby returns
: 'break' code to Tk interpreter (Then the Tk interpreter will
: break the operation for the current event).
: If raise TkCallbackContinue, returns 'continue' code (Then the Tk
: interpreter will break the operateion for the current bindtag and
: starts the operation for the next buindtag for the current event).
: They are exception classes to break or continue the Tk callback
: operation.
: If raise TkCallbackBreak on the callback procedure, Ruby returns
: 'break' code to Tk interpreter (Then the Tk interpreter will
: break the operation for the current event).
: If raise TkCallbackContinue, returns 'continue' code (Then the Tk
: interpreter will break the operateion for the current bindtag and
: starts the operation for the next buindtag for the current event).
(eof)

View file

@ -1,5 +1,5 @@
(tof)
2003/10/17 Hidetoshi NAGAI
2004/03/28 Hidetoshi NAGAI
本ドキュメントには古い tcltk ライブラリtcltklib ライブラリの説明
が含まれていますが,その記述内容は古いものとなっています.
@ -175,6 +175,52 @@ require "tcltklib"
: 処理対象イベントが存在しない場合に,イベント発生を待たず
: に do_one_event を終了 ( false を返す ) する
モジュール TclTkLib::VarAccessFlag
: _get_variable などでのフラグを指定するためのもの.フラグに
: は以下の定数を OR で連結して与える.
定数 NONE
: 値は 0 で,何もフラグを指定していないのに等しい.
定数 GLOBAL_ONLY
: 通常,変数の検索はまず手続き呼び出しを行ったレベルで検
: 索し,次に現在の名前空間で検索,最後にグローバル空間で
: 検索を行う.しかし,このフラグが指定された場合には,グ
: ローバル空間でのみ検索する.
: もし GLOBAL_ONLY と NAMESPACE_ONLY とが両方指定された場
: 合にはGLOBAL_ONLY の指定は無視される.
定数 NAMESPACE_ONLY
: このフラグが指定された場合には,現在の名前空間でのみ変
: 数の検索を行うGLOBAL_ONLY の説明も参照すること.
定数 LEAVE_ERR_MSG
: 変数アクセスにおいてエラーが発生した場合,このフラグが
: 指定されていれば,実行結果として Tcl インタープリタにエ
: ラーメッセージが残される.このフラグが指定されていなけ
: れば,エラーメッセージは一切残されない.
定数 APPEND_VALUE
: このフラグが指定されていた場合,変数の値を置き換えので
: はなく,現在の値に代入値が追加 (append; 文字列連結) さ
: れる.変数が未定義あった場合,このフラグは無視される.
定数 LIST_ELEMENT
: このフラグが指定されていた場合,代入値はまず Tcl のリス
: ト要素として適切となるように変換される.代入値がリスト
: (またはサブリスト) の最初の要素となるのでない限り,代入
: 値の直前には空白文字が追加される.
定数 PARSE_VARNAME
: _set_variable などの呼び出しにおいてこのフラグが指定さ
: れていた場合var_name 引数が連想配列名と要素名とを両方
: 含む可能性がある (開き括弧を含み,閉じ括弧で終わる) こ
: とを示す.その場合,括弧の間が要素名指定,最初の開き括
: 弧までが連想配列名として扱われる_set_variable2 などで
: このフラグを指定する場合,連想配列名と要素名は var_name
: から抽出されるはずであるからindex_name 引数は nil と
: せねばならない.
モジュールメソッド
mainloop(check_root = true)
: イベントループを起動するcheck_root が true であれば,
@ -277,6 +323,26 @@ require "tcltklib"
: ので,この値は現在 Tk の機能が有効であるインタープリタの総
: 数に等しい.
_merge_tklist(str, str, ... )
: Tcl/Tk のライブラリ関数を使って,引数の文字列がそれぞれ
: 正しく一つのリスト要素となるように連結した文字列を返す.
_conv_listelement(str)
: Tcl/Tk のライブラリ関数を使って,引数の文字列が Tcl の
: 一つのリスト要素として適切な表現になるように変換した文
: 字列を返す.
_toUTF8(str, encoding)
_fromUTF8(str, encoding)
: Tcl/Tk が内蔵している UTF8 変換処理を呼び出す.
_subst_UTF_backslash(str)
_subst_Tcl_backslash(str)
: Tcl のルールでバックスラッシュ記法 ( \uhhhh による
: Unicode 文字表現を含む ) を解析する.
: _subst_Tcl_backslash はすべてのバックスラッシュ記法を
: 置き換えるのに対し_subst_UTF_backslash は \uhhhh
: による Unicode 文字表現だけを置き換える.
クラス TclTkIp
クラスメソッド
@ -373,6 +439,52 @@ require "tcltklib"
_return_value
: 直前の Tcl/Tk 上での評価の実行結果としての戻り値を返す.
_get_variable(var_name, flag)
_get_variable2(var_name, index_name, flag)
: Tcl/Tk 上の var という変数名の変数の値を返す.
: もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
: された場合は連想配列 var_name の index_name の要素を返す.
: flag には変数を検索する際の条件を指定するflag に与える
: 値はモジュール TclTkLib::VarAccessFlag を参照すること.
_set_variable(var_name, value, flag)
_set_variable2(var_name, index_name, value, flag)
: Tcl/Tk 上の var という変数名の変数に値を設定する.
: もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
: された場合は連想配列 var_name の index_name の要素を設定
: する.
: flag には変数を検索する際の条件を指定するflag に与える
: 値はモジュール TclTkLib::VarAccessFlag を参照すること.
_unset_variable(var_name)
_unset_variable2(var_name, index_name)
: Tcl/Tk 上の var_name という変数名の変数を消去する.
: もし index_name が指定 (PARSE_VARNAME フラグの説明も参照)
: された場合は連想配列 var_name から index_name の要素だけ
: を消去する.
_get_global_var(var_name)
_get_global_var2(var_name, index_name)
_set_global_var(var_name, value)
_set_global_var2(var_name, index_name, value)
_unset_global_var(var_name)
_unset_global_var2(var_name, index_name)
: それぞれ,対応する変数アクセスメソッドの flag に対して
: (GLOBAL_ONLY | LEAVE_ERR_MSG) を与えたもの.
_split_tklist(str)
: Tcl/Tk のライブラリ関数を使って,文字列 str をリストに
: 分割する (文字列の配列として返す)
_merge_tklist(str, str, ... )
: Tcl/Tk のライブラリ関数を使って,引数の文字列がそれぞれ
: 正しく一つのリスト要素となるように連結した文字列を返す.
_conv_listelement(str)
: Tcl/Tk のライブラリ関数を使って,引数の文字列が Tcl の
: 一つのリスト要素として適切な表現になるように変換した文
: 字列を返す.
mainloop
mainloop_watchdog
: スレーブ IP の場合にはイベントループを起動せずに nil を返す.

View file

@ -8,7 +8,7 @@ some or all of the following options.
--with-tcllib=<libname> (e.g. libtcl8.3.so ==> --with-tcllib=tcl8.3)
--with-tklib=<libname> (e.g. libtk8.3.so ==> --with-tklib=tk8.3)
--enable_tcltk_stubs (if you force to enable stubs)
--enable-tcltk_stubs (if you force to enable stubs)
--with-tcl-dir=<path>
equal to "--with-tcl-include=<path>/include --with-tcl-lib=<path>/lib"

View file

@ -1,6 +1,6 @@
#! /usr/local/bin/ruby
require "tk"
require "tcltk"
def drawlines()
print Time.now, "\n"
@ -14,7 +14,7 @@ def drawlines()
col = "red"
end
for i in 0 .. 99
# TkcLine.new($a, i, 0, 0, 500 - i, "-fill", col)
# $a.e("create line", i, 0, 0, 500 - i, "-fill", col)
end
end
@ -29,26 +29,22 @@ def drawlines()
col = "red"
end
for i in 0 .. 99
TkcLine.new($a, i, 0, 0, 500 - i, "-fill", col)
$a.e("create line", i, 0, 0, 500 - i, "-fill", col)
end
end
print Time.now, "\n"
# Tk.root.destroy
# $ip.commands()["destroy"].e($root)
end
$a = TkCanvas.new{
height(500)
width(500)
}
$ip = TclTkInterpreter.new()
$root = $ip.rootwidget()
$a = TclTkWidget.new($ip, $root, "canvas", "-height 500 -width 500")
$c = TclTkCallback.new($ip, proc{drawlines()})
$b = TclTkWidget.new($ip, $root, "button", "-text draw -command", $c)
$b = TkButton.new{
text("draw")
command(proc{drawlines()})
}
$ip.commands()["pack"].e($a, $b, "-side left")
TkPack.configure($a, $b, {"side"=>"left"})
Tk.mainloop
TclTk.mainloop
# eof

View file

@ -1,6 +1,6 @@
#! /usr/local/bin/ruby
require "tcltk"
require "tk"
def drawlines()
print Time.now, "\n"
@ -14,7 +14,7 @@ def drawlines()
col = "red"
end
for i in 0 .. 99
# $a.e("create line", i, 0, 0, 500 - i, "-fill", col)
# TkcLine.new($a, i, 0, 0, 500 - i, "-fill", col)
end
end
@ -29,22 +29,26 @@ def drawlines()
col = "red"
end
for i in 0 .. 99
$a.e("create line", i, 0, 0, 500 - i, "-fill", col)
TkcLine.new($a, i, 0, 0, 500 - i, "-fill", col)
end
end
print Time.now, "\n"
# $ip.commands()["destroy"].e($root)
# Tk.root.destroy
end
$ip = TclTkInterpreter.new()
$root = $ip.rootwidget()
$a = TclTkWidget.new($ip, $root, "canvas", "-height 500 -width 500")
$c = TclTkCallback.new($ip, proc{drawlines()})
$b = TclTkWidget.new($ip, $root, "button", "-text draw -command", $c)
$a = TkCanvas.new{
height(500)
width(500)
}
$ip.commands()["pack"].e($a, $b, "-side left")
$b = TkButton.new{
text("draw")
command(proc{drawlines()})
}
TclTk.mainloop
TkPack.configure($a, $b, {"side"=>"left"})
Tk.mainloop
# eof

View file

@ -2,7 +2,9 @@
require 'mkmf'
if RUBY_PLATFORM !~ /mswin32|mingw|cygwin|bccwin32/
is_win32 = (/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM)
unless is_win32
have_library("nsl", "t_open")
have_library("socket", "socket")
have_library("dl", "dlopen")
@ -25,7 +27,7 @@ def find_tcl(tcllib, stubs)
elsif find_library("tcl", func, *paths)
true
else
%w[8.4 8.3 8.2 8.0 7.6].find { |ver|
%w[8.5 8.4 8.3 8.2 8.1 8.0 7.6].find { |ver|
find_library("tcl#{ver}", func, *paths) or
find_library("tcl#{ver.delete('.')}", func, *paths)
}
@ -40,7 +42,7 @@ def find_tk(tklib, stubs)
elsif find_library("tk", func, *paths)
true
else
%w[8.4 8.3 8.2 8.0 4.2].find { |ver|
%w[8.5 8.4 8.3 8.2 8.1 8.0 4.2].find { |ver|
find_library("tk#{ver}", func, *paths) or
find_library("tk#{ver.delete('.')}", func, *paths)
}
@ -48,11 +50,73 @@ def find_tk(tklib, stubs)
end
if have_header("tcl.h") && have_header("tk.h") &&
(/mswin32|mingw|cygwin|bccwin32/ =~ RUBY_PLATFORM || find_library("X11", "XOpenDisplay",
"/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib")) &&
(is_win32 || find_library("X11", "XOpenDisplay",
"/usr/X11/lib", "/usr/lib/X11", "/usr/X11R6/lib", "/usr/openwin/lib")) &&
find_tcl(tcllib, stubs) &&
find_tk(tklib, stubs)
$CPPFLAGS += ' -DUSE_TCL_STUBS -DUSE_TK_STUBS' if stubs
$CPPFLAGS += ' -D_WIN32' if /cygwin/ =~ RUBY_PLATFORM
create_makefile("tcltklib")
pthread_enabled = macro_defined?('HAVE_LIBPTHREAD', '#include "ruby.h"')
if try_run(<<EOF)
#include <tcl.h>
static Tcl_ThreadDataKey dataKey;
int main() { exit((Tcl_GetThreadData(&dataKey, 1) == dataKey)? 1: 0); }
EOF
tcl_enable_thread = true
else
tcl_enable_thread = false
end
unless pthread_enabled
if tcl_enable_thread
# ruby -> disable && tcl -> enable
puts(%Q'\
*****************************************************************************
**
** PTHREAD SUPPORT MODE ERRROR:
**
** Ruby is not compiled with --enable-pthread, but your Tcl/Tk
** libararies seems to be compiled with "pthread support". This
** combination possibly cause "Hang-up" or "Segmentation Fault"
** frequently when Ruby/Tk is working. We NEVER recommend you to
** create the library under such combination of pthread support.
**
** Please recompile Ruby with "--enable-pthread" configure option
** or recompile Tcl/Tk with "--disable-threads" configure option.
**
*****************************************************************************
')
else
# ruby -> disable && tcl -> disable
create_makefile("tcltklib")
end
else
unless tcl_enable_thread
# ruby -> enable && tcl -> disable
puts(%Q'\
*****************************************************************************
**
** PTHREAD SUPPORT MODE WARNING:
**
** Ruby is compiled with --enable-pthread, but your Tcl/Tk libraries
** seems to be compiled without "pthread support". Although You can
** create tcltklib library, this combination may cause memory trouble
** (e.g. "Hang-up" or "Segmentation Fault"). If you have no reason you
** must have to keep current pthread support status, we recommend you
** to make both or neither libraries to support pthread.
**
** If you want change the status of pthread support, please recompile
** Ruby without "--enable-pthread" configure option or recompile Tcl/Tk
** with "--enable-threads" configure option (if your Tcl/Tk is later
** than Tcl/Tk8.1).
**
*****************************************************************************
')
end
# ruby -> enable && tcl -> enable/disable
create_makefile("tcltklib")
end
end

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,6 @@
MANIFEST
README.1st
README.fork
extconf.rb
depend
tkutil.c
@ -22,6 +23,77 @@ lib/tkscrollbox.rb
lib/tktext.rb
lib/tkvirtevent.rb
lib/tkwinpkg.rb
lib/tk/after.rb
lib/tk/autoload.rb
lib/tk/bgerror.rb
lib/tk/bindtag.rb
lib/tk/button.rb
lib/tk/canvas.rb
lib/tk/canvastag.rb
lib/tk/checkbutton.rb
lib/tk/clipboard.rb
lib/tk/clock.rb
lib/tk/composite.rb
lib/tk/console.rb
lib/tk/dialog.rb
lib/tk/encodedstr.rb
lib/tk/entry.rb
lib/tk/event.rb
lib/tk/font.rb
lib/tk/frame.rb
lib/tk/grid.rb
lib/tk/image.rb
lib/tk/itemfont.rb
lib/tk/kinput.rb
lib/tk/label.rb
lib/tk/labelframe.rb
lib/tk/listbox.rb
lib/tk/macpkg.rb
lib/tk/menu.rb
lib/tk/menubar.rb
lib/tk/message.rb
lib/tk/mngfocus.rb
lib/tk/msgcat.rb
lib/tk/namespace.rb
lib/tk/optiondb.rb
lib/tk/pack.rb
lib/tk/package.rb
lib/tk/palette.rb
lib/tk/panedwindow.rb
lib/tk/place.rb
lib/tk/radiobutton.rb
lib/tk/root.rb
lib/tk/scale.rb
lib/tk/scrollable.rb
lib/tk/scrollbar.rb
lib/tk/scrollbox.rb
lib/tk/selection.rb
lib/tk/spinbox.rb
lib/tk/tagfont.rb
lib/tk/text.rb
lib/tk/textimage.rb
lib/tk/textmark.rb
lib/tk/texttag.rb
lib/tk/textwindow.rb
lib/tk/timer.rb
lib/tk/toplevel.rb
lib/tk/txtwin_abst.rb
lib/tk/validation.rb
lib/tk/variable.rb
lib/tk/virtevent.rb
lib/tk/winfo.rb
lib/tk/winpkg.rb
lib/tk/wm.rb
lib/tk/xim.rb
sample/binding_sample.rb
sample/bindtag_sample.rb
sample/binstr_usage.rb
sample/btn_with_frame.rb
sample/encstr_usage.rb
sample/iso2022-kr.txt
sample/propagate.rb
sample/resource.en
sample/resource.ja
sample/safe-tk.rb
sample/tkalignbox.rb
sample/tkballoonhelp.rb
@ -33,20 +105,22 @@ sample/tkfrom.rb
sample/tkhello.rb
sample/tkline.rb
sample/tkmenubutton.rb
sample/tkmsgcat-load_rb.rb
sample/tkmsgcat-load_rb2.rb
sample/tkmsgcat-load_tk.rb
sample/tkmulticolumnlist.rb
sample/tkmultilistbox.rb
sample/tkmultilistframe.rb
sample/tkoptdb-safeTk.rb
sample/tkoptdb.rb
sample/tktextframe.rb
sample/resource.ja
sample/resource.en
sample/tktimer.rb
sample/tktimer2.rb
sample/tktimer3.rb
sample/demos-en/ChangeLog
sample/demos-en/ChangeLog.prev
sample/demos-en/README
sample/demos-en/README.1st
sample/demos-en/README.tkencoding
sample/demos-en/arrow.rb
sample/demos-en/bind.rb
@ -55,6 +129,7 @@ sample/demos-en/browse1
sample/demos-en/browse2
sample/demos-en/button.rb
sample/demos-en/check.rb
sample/demos-en/check2.rb
sample/demos-en/clrpick.rb
sample/demos-en/colors.rb
sample/demos-en/cscroll.rb
@ -71,6 +146,7 @@ sample/demos-en/entry2.rb
sample/demos-en/entry3.rb
sample/demos-en/filebox.rb
sample/demos-en/floor.rb
sample/demos-en/floor2.rb
sample/demos-en/form.rb
sample/demos-en/hello
sample/demos-en/hscale.rb
@ -78,19 +154,6 @@ sample/demos-en/icon.rb
sample/demos-en/image1.rb
sample/demos-en/image2.rb
sample/demos-en/image3.rb
sample/demos-en/images/earth.gif
sample/demos-en/images/earthris.gif
sample/demos-en/images/face.xbm
sample/demos-en/images/flagdown.xbm
sample/demos-en/images/flagup.xbm
sample/demos-en/images/gray25.xbm
sample/demos-en/images/grey.25
sample/demos-en/images/grey.5
sample/demos-en/images/letters.xbm
sample/demos-en/images/noletter.xbm
sample/demos-en/images/pattern.xbm
sample/demos-en/images/tcllogo.gif
sample/demos-en/images/teapot.ppm
sample/demos-en/items.rb
sample/demos-en/ixset
sample/demos-en/ixset2
@ -107,6 +170,7 @@ sample/demos-en/plot.rb
sample/demos-en/puzzle.rb
sample/demos-en/radio.rb
sample/demos-en/radio2.rb
sample/demos-en/radio3.rb
sample/demos-en/rmt
sample/demos-en/rolodex
sample/demos-en/rolodex-j
@ -123,6 +187,7 @@ sample/demos-en/text.rb
sample/demos-en/timer
sample/demos-en/tkencoding.rb
sample/demos-en/twind.rb
sample/demos-en/twind2.rb
sample/demos-en/unicodeout.rb
sample/demos-en/vscale.rb
sample/demos-en/widget
@ -134,6 +199,7 @@ sample/demos-jp/browse1
sample/demos-jp/browse2
sample/demos-jp/button.rb
sample/demos-jp/check.rb
sample/demos-jp/check2.rb
sample/demos-jp/clrpick.rb
sample/demos-jp/colors.rb
sample/demos-jp/cscroll.rb
@ -150,6 +216,7 @@ sample/demos-jp/entry2.rb
sample/demos-jp/entry3.rb
sample/demos-jp/filebox.rb
sample/demos-jp/floor.rb
sample/demos-jp/floor2.rb
sample/demos-jp/form.rb
sample/demos-jp/hello
sample/demos-jp/hscale.rb
@ -157,19 +224,6 @@ sample/demos-jp/icon.rb
sample/demos-jp/image1.rb
sample/demos-jp/image2.rb
sample/demos-jp/image3.rb
sample/demos-jp/images/earth.gif
sample/demos-jp/images/earthris.gif
sample/demos-jp/images/face.bmp
sample/demos-jp/images/flagdown.bmp
sample/demos-jp/images/flagup.bmp
sample/demos-jp/images/gray25.bmp
sample/demos-jp/images/grey.25
sample/demos-jp/images/grey.5
sample/demos-jp/images/letters.bmp
sample/demos-jp/images/noletter.bmp
sample/demos-jp/images/pattern.bmp
sample/demos-jp/images/tcllogo.gif
sample/demos-jp/images/teapot.ppm
sample/demos-jp/items.rb
sample/demos-jp/ixset
sample/demos-jp/ixset2
@ -186,6 +240,7 @@ sample/demos-jp/plot.rb
sample/demos-jp/puzzle.rb
sample/demos-jp/radio.rb
sample/demos-jp/radio2.rb
sample/demos-jp/radio3.rb
sample/demos-jp/rmt
sample/demos-jp/rolodex
sample/demos-jp/rolodex-j
@ -200,6 +255,51 @@ sample/demos-jp/tcolor
sample/demos-jp/text.rb
sample/demos-jp/timer
sample/demos-jp/twind.rb
sample/demos-jp/twind2.rb
sample/demos-jp/unicodeout.rb
sample/demos-jp/vscale.rb
sample/demos-jp/widget
sample/images/earth.gif
sample/images/earthris.gif
sample/images/face.xbm
sample/images/flagdown.xbm
sample/images/flagup.xbm
sample/images/gray25.xbm
sample/images/grey.25
sample/images/grey.5
sample/images/letters.xbm
sample/images/noletter.xbm
sample/images/pattern.xbm
sample/images/tcllogo.gif
sample/images/teapot.ppm
sample/msgs_rb/README
sample/msgs_rb/cs.msg
sample/msgs_rb/de.msg
sample/msgs_rb/el.msg
sample/msgs_rb/en.msg
sample/msgs_rb/en_gb.msg
sample/msgs_rb/eo.msg
sample/msgs_rb/es.msg
sample/msgs_rb/fr.msg
sample/msgs_rb/it.msg
sample/msgs_rb/ja.msg
sample/msgs_rb/nl.msg
sample/msgs_rb/pl.msg
sample/msgs_rb/ru.msg
sample/msgs_rb2/README
sample/msgs_rb2/de.msg
sample/msgs_rb2/ja.msg
sample/msgs_tk/README
sample/msgs_tk/cs.msg
sample/msgs_tk/de.msg
sample/msgs_tk/el.msg
sample/msgs_tk/en.msg
sample/msgs_tk/en_gb.msg
sample/msgs_tk/eo.msg
sample/msgs_tk/es.msg
sample/msgs_tk/fr.msg
sample/msgs_tk/it.msg
sample/msgs_tk/ja.msg
sample/msgs_tk/nl.msg
sample/msgs_tk/pl.msg
sample/msgs_tk/ru.msg

View file

@ -1,2 +1,3 @@
require 'mkmf'
$preload = ["tcltklib"]
create_makefile("tkutil")

View file

@ -3,6 +3,7 @@
# by Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
require 'tcltklib'
require 'tkutil'
require 'thread'
################################################
@ -13,7 +14,6 @@ TclTkLib.mainloop_abort_on_exception = true
# TclTkLib.mainloop_abort_on_exception = nil
################################################
# exceptiopn to treat the return value from IP
class MultiTkIp_OK < Exception
@ -48,12 +48,15 @@ class MultiTkIp
######################################
@@CB_ENTRY_CLASS = Class.new{|c|
@@CB_ENTRY_CLASS = Class.new(TkCallbackEntry){|c|
def initialize(ip, cmd)
@ip = ip
@cmd = cmd
end
attr_reader :ip, :cmd
def inspect
cmd.inspect
end
def call(*args)
begin
unless @ip.deleted?
@ -68,8 +71,11 @@ class MultiTkIp
######################################
def _keys2opts(keys)
keys.collect{|k,v| "-#{k} #{v}"}.join(' ')
def _keys2opts(src_keys)
return nil if src_keys == nil
keys = {}; src_keys.each{|k, v| keys[k.to_s] = v}
#keys.collect{|k,v| "-#{k} #{v}"}.join(' ')
keys.collect{|k,v| "-#{k} #{TclTkLib._conv_listelement(TkComm::_get_eval_string(v))}"}.join(' ')
end
private :_keys2opts
@ -136,10 +142,11 @@ class MultiTkIp
rescue SystemExit
# delete IP
unless @interp.deleted?
if @interp._invoke('info', 'command', '.') != ""
@interp._invoke('destroy', '.')
end
@interp.delete
# if @interp._invoke('info', 'command', '.') != ""
# @interp._invoke('destroy', '.')
# end
# @interp.delete
@interp._eval_without_enc('exit')
end
_check_and_return(thread, MultiTkIp_OK.new(nil))
break
@ -200,14 +207,14 @@ class MultiTkIp
@@DEFAULT_MASTER = self.allocate
@@DEFAULT_MASTER.instance_eval{
@encoding = [].taint
@tk_windows = {}.taint
@tk_table_list = [].taint
@slave_ip_tbl = {}.taint
@slave_ip_top = {}.taint
unless keys.kind_of? Hash
fail ArgumentError, "expecting a Hash object for the 2nd argument"
end
@ -274,23 +281,28 @@ class MultiTkIp
tk_opts = {}
keys.each{|k,v|
if k.to_s == 'name'
k_str = k.to_s
if k_str == 'name'
name = v
elsif k.to_s == 'safe'
elsif k_str == 'safe'
safe = v
elsif SAFE_OPT_LIST.member?(k.to_s)
safe_opts[k] = v
elsif SAFE_OPT_LIST.member?(k_str)
safe_opts[k_str] = v
else
tk_opts[k] = v
tk_opts[k_str] = v
end
}
[name, safe, safe_opts, tk_opts]
if keys['without_tk'] || keys[:without_tk]
[name, safe, safe_opts, nil]
else
[name, safe, safe_opts, tk_opts]
end
end
private :_parse_slaveopts
def _create_slave_ip_name
name = SLAVE_IP_ID.join
name = SLAVE_IP_ID.join('')
SLAVE_IP_ID[1].succ!
name
end
@ -388,14 +400,18 @@ class MultiTkIp
# procedure to delete slave interpreter
slave_delete_proc = proc{
unless slave_ip.deleted?
if slave_ip._invoke('info', 'command', '.') != ""
slave_ip._invoke('destroy', '.')
end
slave_ip.delete
#if slave_ip._invoke('info', 'command', '.') != ""
# slave_ip._invoke('destroy', '.')
#end
#slave_ip.delete
slave_ip._eval_without_enc('exit')
end
top.destroy if top.winfo_exist?
}
tag = TkBindTag.new.bind('Destroy', slave_delete_proc)
top.bindtags = top.bindtags.unshift(tag)
# create control frame
TkFrame.new(top, :bg=>'red', :borderwidth=>3, :relief=>'ridge') {|fc|
fc.bindtags = fc.bindtags.unshift(tag)
@ -421,23 +437,45 @@ class MultiTkIp
# return keys
loadTk_keys['use'] = TkWinfo.id(c)
loadTk_keys
[loadTk_keys, top.path]
end
private :__create_safetk_frame
def __create_safe_slave_obj(safe_opts, app_name, tk_opts)
# safe interpreter
# at present, not enough support for '-deleteHook' option
ip_name = _create_slave_ip_name
slave_ip = @interp.create_slave(ip_name, true)
@interp._eval("::safe::interpInit #{ip_name} "+_keys2opts(safe_opts))
tk_opts = __check_safetk_optkeys(tk_opts)
unless tk_opts.key?('use')
tk_opts = __create_safetk_frame(slave_ip, ip_name, app_name, tk_opts)
end
slave_ip._invoke('set', 'argv0', app_name) if app_name.kind_of?(String)
@interp._eval("::safe::loadTk #{ip_name} #{_keys2opts(tk_opts)}")
@slave_ip_tbl[ip_name] = slave_ip
@interp._eval("::safe::interpInit #{ip_name}")
slave_ip._invoke('set', 'argv0', app_name) if app_name.kind_of?(String)
if tk_opts
tk_opts = __check_safetk_optkeys(tk_opts)
if tk_opts.key?('use')
@slave_ip_top[ip_name] = ''
else
tk_opts, top_path = __create_safetk_frame(slave_ip, ip_name, app_name,
tk_opts)
@slave_ip_top[ip_name] = top_path
end
@interp._eval("::safe::loadTk #{ip_name} #{_keys2opts(tk_opts)}")
else
@slave_ip_top[ip_name] = nil
end
if safe_opts.key?('deleteHook') || safe_opts.key?(:deleteHook)
@interp._eval("::safe::interpConfigure #{ip_name} " +
_keys2opts(safe_opts))
else
@interp._eval("::safe::interpConfigure #{ip_name} " +
_keys2opts(safe_opts) + '-deleteHook {' +
TkComm._get_eval_string(proc{|slave|
self._default_delete_hook(slave)
}) + '}')
end
[slave_ip, ip_name]
end
@ -481,15 +519,15 @@ class MultiTkIp
fail ArgumentError, "expecting a Hash object for the 2nd argument"
end
@encoding = []
@tk_windows = {}
@tk_table_list = []
@slave_ip_tbl = {}
@slave_ip_top = {}
@encoding.taint unless @encoding.tainted?
@tk_windows.taint unless @tk_windows.tainted?
@tk_table_list.taint unless @tk_table_list.tainted?
@slave_ip_tbl.taint unless @slave_ip_tbl.tainted?
@slave_ip_top.taint unless @slave_ip_top.tainted?
name, safe, safe_opts, tk_opts = _parse_slaveopts(keys)
@ -532,6 +570,34 @@ class MultiTkIp
self.freeze # defend against modification
end
######################################
def _default_delete_hook(slave)
if @slave_ip_top[slave].kind_of?(String)
# call default hook of safetk.tcl (ignore exceptions)
if @slave_ip_top[slave] == ''
begin
@interp._eval("::safe::disallowTk #{slave}")
rescue
warn("Waring: fail to call '::safe::disallowTk'") if $DEBUG
end
else # toplevel path
begin
@interp._eval("::safe::tkDelete {} #{@slave_ip_top[slave]} #{slave}")
rescue
warn("Waring: fail to call '::safe::tkDelete'") if $DEBUG
begin
@interp._eval("destroy #{@slave_ip_top[slave]}")
rescue
warn("Waring: fail to destroy toplevel") if $DEBUG
end
end
end
end
@slave_ip_tbl.delete(slave)
@slave_ip_top.delete(slave)
end
end
@ -796,6 +862,10 @@ class MultiTkIp
rescue SystemExit
# exit IP
warn("Warning: "+ $! + " on " + self.inspect) if $DEBUG
begin
self._eval_without_enc('exit')
rescue Exception
end
self.delete
ret = nil
rescue Exception => e
@ -823,6 +893,10 @@ class MultiTkIp
rescue SystemExit
# exit IP
warn("Warning: " + $! + " on " + self.inspect) if $DEBUG
begin
self._eval_without_enc('exit')
rescue Exception
end
self.delete
rescue Exception => e
# others --> warning
@ -868,10 +942,12 @@ class << MultiTkIp
__getip.do_one_event(flag)
end
def mainloop_abort_on_exception
__getip.mainloop_abort_on_exception
# __getip.mainloop_abort_on_exception
TclTkLib.mainloop_abort_on_exception
end
def mainloop_abort_on_exception=(mode)
__getip.mainloop_abort_on_exception=(mode)
# __getip.mainloop_abort_on_exception=(mode)
TclTkLib.mainloop_abort_on_exception=(mode)
end
def set_eventloop_tick(tick)
__getip.set_eventloop_tick(tick)
@ -919,6 +995,22 @@ class << MultiTkIp
__getip._invoke(*args)
end
def _eval_without_enc(str)
__getip._eval_without_enc(str)
end
def _invoke_without_enc(*args)
__getip._invoke_without_enc(*args)
end
def _eval_with_enc(str)
__getip._eval_with_enc(str)
end
def _invoke_with_enc(*args)
__getip._invoke_with_enc(*args)
end
def _toUTF8(str, encoding)
__getip._toUTF8(str, encoding)
end
@ -938,6 +1030,54 @@ class << MultiTkIp
def _return_value
__getip._return_value
end
def _get_variable(var, flag)
__getip._get_variable(var, flag)
end
def _get_variable2(var, idx, flag)
__getip._get_variable2(var, idx, flag)
end
def _set_variable(var, value, flag)
__getip._set_variable(var, value, flag)
end
def _set_variable2(var, idx, value, flag)
__getip._set_variable2(var, idx, value, flag)
end
def _unset_variable(var, flag)
__getip._unset_variable(var, flag)
end
def _unset_variable2(var, idx, flag)
__getip._unset_variable2(var, idx, flag)
end
def _get_global_var(var)
__getip._get_global_var(var)
end
def _get_global_var2(var, idx)
__getip._get_global_var2(var, idx)
end
def _set_global_var(var, value)
__getip._set_global_var(var, value)
end
def _set_global_var2(var, idx, value)
__getip._set_global_var2(var, idx, value)
end
def _unset_global_var(var)
__getip._unset_global_var(var)
end
def _unset_global_var2(var, idx)
__getip._unset_global_var2(var, idx)
end
def _split_tklist(str)
__getip._split_tklist(str)
end
def _merge_tklist(*args)
__getip._merge_tklist(*args)
end
def _conv_listelement(arg)
__getip._conv_listelement(arg)
end
end
@ -952,12 +1092,12 @@ class << TclTkLib
def do_one_event(flag = TclTkLib::EventFlag::ALL)
MultiTkIp.do_one_event(flag)
end
def mainloop_abort_on_exception
MultiTkIp.mainloop_abort_on_exception
end
def mainloop_abort_on_exception=(mode)
MultiTkIp.mainloop_abort_on_exception=(mode)
end
#def mainloop_abort_on_exception
# MultiTkIp.mainloop_abort_on_exception
#end
#def mainloop_abort_on_exception=(mode)
# MultiTkIp.mainloop_abort_on_exception=(mode)
#end
def set_eventloop_tick(tick)
MultiTkIp.set_eventloop_tick(tick)
end
@ -979,12 +1119,19 @@ class << TclTkLib
def restart
MultiTkIp.restart
end
def _merge_tklist(*args)
MultiTkIp._merge_tklist(*args)
end
def _conv_listelement(arg)
MultiTkIp._conv_listelement(arg)
end
end
# depend on TclTkIp
class MultiTkIp
def mainloop(check_root = true, restart_on_dead = true)
def mainloop(check_root = true, restart_on_dead = false)
return self if self.slave?
unless restart_on_dead
@interp.mainloop(check_root)
@ -1022,6 +1169,10 @@ class MultiTkIp
end
def delete
if safe?
# do 'exit' to call the delete_hook procedure
@interp._eval_without_enc('exit')
end
@interp.delete
end
@ -1041,6 +1192,22 @@ class MultiTkIp
@interp._invoke(*args)
end
def _eval_without_enc(str)
@interp._eval_without_enc(str)
end
def _invoke_without_enc(*args)
@interp._invoke_without_enc(*args)
end
def _eval_with_enc(str)
@interp._eval_with_enc(str)
end
def _invoke_with_enc(*args)
@interp._invoke_with_enc(*args)
end
def _toUTF8(str, encoding)
@interp._toUTF8(str, encoding)
end
@ -1060,6 +1227,54 @@ class MultiTkIp
def _return_value
@interp._return_value
end
def _get_variable(var, flag)
@interp._get_variable(var, flag)
end
def _get_variable2(var, idx, flag)
@interp._get_variable2(var, idx, flag)
end
def _set_variable(var, value, flag)
@interp._set_variable(var, value, flag)
end
def _set_variable2(var, idx, value, flag)
@interp._set_variable2(var, idx, value, flag)
end
def _unset_variable(var, flag)
@interp._unset_variable(var, flag)
end
def _unset_variable2(var, idx, flag)
@interp._unset_variable2(var, idx, flag)
end
def _get_global_var(var)
@interp._get_global_var(var)
end
def _get_global_var2(var, idx)
@interp._get_global_var2(var, idx)
end
def _set_global_var(var, value)
@interp._set_global_var(var, value)
end
def _set_global_var2(var, idx, value)
@interp._set_global_var2(var, idx, value)
end
def _unset_global_var(var)
@interp._unset_global_var(var)
end
def _unset_global_var2(var, idx)
@interp._unset_global_var2(var, idx)
end
def _split_tklist(str)
@interp._split_tklist(str)
end
def _merge_tklist(*args)
@interp._merge_tklist(*args)
end
def _conv_listelement(arg)
@interp._conv_listelement(arg)
end
end
@ -1090,7 +1305,7 @@ class MultiTkIp
else
list.push str[0..i-1]
end
list += tk_split_simplelist(str[i+1..-1])
list += _lst2ary(str[i+1..-1])
list
end
private :_lst2ary
@ -1224,6 +1439,14 @@ class MultiTkIp
self
end
def recursion_limit(slave = '', limit = None)
number(@interp._invoke('interp', 'recursionlimit',
_slavearg(slave), limit))
end
def self.recursion_limit(slave = '', limit = None)
__getip.recursion_limit(slave)
end
def alias_target(aliascmd, slave = '')
@interp._invoke('interp', 'target', _slavearg(slave), aliascmd)
end
@ -1309,35 +1532,94 @@ class MultiTkIp
end
# Safe Base :: manipulating safe interpreter
class MultiTkIp
def safeip_configure(slave, slot, value=None)
# use for '-noStatics' option ==> {statics=>false}
# for '-nestedLoadOk' option ==> {nested=>true}
if slot.kind_of?(Hash)
ip = MultiTkIp.__getip
ip._eval('::safe::interpConfigure ' + @ip_name + ' ' +
hash_kv(slot).join(' '))
else
ip._eval('::safe::interpConfigure ' + @ip_name + ' ' +
"-#{slot} #{_get_eval_string(value)}")
end
self
end
def safeip_configinfo(slot = nil)
ip = MultiTkIp.__getip
ret = {}
if slot
conf = _lst2ary(ip._eval("::safe::interpConfigure " +
@ip_name + " -#{slot}"))
if conf[0] == '-deleteHook'
if conf[1] =~ /^rb_out (c\d+)/
ret[conf[0][1..-1]] = MultiTkIp._tk_cmd_tbl[$1]
else
ret[conf[0][1..-1]] = conf[1]
end
else
ret[conf[0][1..-1]] = conf[1]
end
else
Hash[*_lst2ary(ip._eval("::safe::interpConfigure " +
@ip_name))].each{|k, v|
if k == '-deleteHook'
if v =~ /^rb_out (c\d+)/
ret[k[1..-1]] = MultiTkIp._tk_cmd_tbl[$1]
else
ret[k[1..-1]] = v
end
else
ret[k[1..-1]] = v
end
}
end
ret
end
def safeip_delete(slave)
ip = MultiTkIp.__getip
ip._eval("::safe::interpDelete " + @ip_name)
end
def safeip_add_to_access_path(slave, dir)
ip = MultiTkIp.__getip
ip._eval("::safe::interpAddToAccessPath #{@ip_name} #{dir}")
end
def safeip_find_in_access_path(slave, dir)
ip = MultiTkIp.__getip
ip._eval("::safe::interpFindInAccessPath #{@ip_name} #{dir}")
end
def safeip_set_log_cmd(slave, cmd = Proc.new)
ip = MultiTkIp.__getip
ip._eval("::safe::setLogCmd #{@ip_name} #{_get_eval_string(cmd)}")
end
end
# encoding convert
class MultiTkIp
# from tkencoding.rb by ttate@jaist.ac.jp
alias __eval _eval
alias __invoke _invoke
def encoding
@encoding[0]
@interp.encoding
end
def encoding=(enc)
@encoding[0] = enc
end
def _eval(cmd)
if @encoding[0] != nil
_fromUTF8(__eval(_toUTF8(cmd, @encoding[0])), @encoding[0])
else
__eval(cmd)
end
@interp.encoding = enc
end
def _invoke(*cmds)
if defined?(@encoding[0]) && @encoding[0] != nil
cmds = cmds.collect{|cmd| _toUTF8(cmd, @encoding[0])}
_fromUTF8(__invoke(*cmds), @encoding[0])
else
__invoke(*cmds)
end
def encoding_convertfrom(str, enc=None)
@interp.encoding_convertfrom(str, enc)
end
alias encoding_convert_from encoding_convertfrom
def encoding_convertto(str, enc=None)
@interp.encoding_convertto(str, enc)
end
alias encoding_convert_to encoding_convertto
end

File diff suppressed because it is too large Load diff

View file

@ -1,414 +1,4 @@
#
# tkafter.rb : methods for Tcl/Tk after command
# tkafter.rb - load tk/after.rb
#
# $Id$
#
require 'tk'
class TkTimer
include TkCore
extend TkCore
TkCommandNames = ['after'.freeze].freeze
Tk_CBID = ['a'.freeze, '00000'.taint].freeze
Tk_CBTBL = {}.taint
TkCore::INTERP.add_tk_procs('rb_after', 'id', <<-'EOL')
if {[set st [catch {ruby [format "TkTimer.callback %%Q!%s!" $id]} ret]] != 0} {
return -code $st $ret
} {
return $ret
}
EOL
###############################
# class methods
###############################
def self.callback(obj_id)
@after_id = nil
ex_obj = Tk_CBTBL[obj_id]
return "" if ex_obj == nil; # canceled
ex_obj.cb_call
end
def self.info
tk_call('after', 'info').split(' ').collect!{|id|
ret = Tk_CBTBL.find{|key,val| val.after_id == id}
(ret == nil)? id: ret[1]
}
end
###############################
# instance methods
###############################
def do_callback
@in_callback = true
begin
@return_value = @current_proc.call(self)
rescue Exception => e
if @cancel_on_exception
cancel
@return_value = e
return e
else
fail e
end
end
if @set_next
set_next_callback(@current_args)
else
@set_next = true
end
@in_callback = false
@return_value
end
def set_callback(sleep, args=nil)
@after_script = "rb_after #{@id}"
@after_id = tk_call('after', sleep, @after_script)
@current_args = args
@current_script = [sleep, @after_script]
self
end
def set_next_callback(args)
if @running == false || @proc_max == 0 || @do_loop == 0
Tk_CBTBL.delete(@id) ;# for GC
@running = false
@wait_var.value = 0
return
end
if @current_pos >= @proc_max
if @do_loop < 0 || (@do_loop -= 1) > 0
@current_pos = 0
else
Tk_CBTBL.delete(@id) ;# for GC
@running = false
@wait_var.value = 0
return
end
end
@current_args = args
if @sleep_time.kind_of? Proc
sleep = @sleep_time.call(self)
else
sleep = @sleep_time
end
@current_sleep = sleep
cmd, *cmd_args = @loop_proc[@current_pos]
@current_pos += 1
@current_proc = cmd
set_callback(sleep, cmd_args)
end
def initialize(*args)
@id = Tk_CBID.join
Tk_CBID[1].succ!
@wait_var = TkVariable.new(0)
@cb_cmd = TkCore::INTERP.get_cb_entry(self.method(:do_callback))
@set_next = true
@init_sleep = 0
@init_proc = nil
@init_args = []
@current_script = []
@current_proc = nil
@current_args = nil
@return_value = nil
@sleep_time = 0
@current_sleep = 0
@loop_exec = 0
@do_loop = 0
@loop_proc = []
@proc_max = 0
@current_pos = 0
@after_id = nil
@after_script = nil
@cancel_on_exception = true
set_procs(*args) if args != []
@running = false
@in_callback = false
end
attr :after_id
attr :after_script
attr :current_proc
attr :current_args
attr :current_sleep
alias :current_interval :current_sleep
attr :return_value
attr_accessor :loop_exec
def cb_call
@cb_cmd.call
end
def get_procs
[@init_sleep, @init_proc, @init_args, @sleep_time, @loop_exec, @loop_proc]
end
def current_status
[@running, @current_sleep, @current_proc, @current_args,
@do_loop, @cancel_on_exception]
end
def cancel_on_exception?
@cancel_on_exception
end
def cancel_on_exception=(mode)
@cancel_on_exception = mode
self
end
def running?
@running
end
def loop_rest
@do_loop
end
def loop_rest=(rest)
@do_loop = rest
self
end
def set_procs(interval, loop_exec, *procs)
if !interval == 'idle' \
&& !interval.kind_of?(Integer) && !interval.kind_of?(Proc)
fail Kernel.format("%s need to be Integer or Proc", interval.inspect)
end
@sleep_time = interval
@loop_proc = []
procs.each{|e|
if e.kind_of? Proc
@loop_proc.push([e])
else
@loop_proc.push(e)
end
}
@proc_max = @loop_proc.size
@current_pos = 0
@do_loop = 0
if loop_exec
if loop_exec.kind_of?(Integer) && loop_exec < 0
@loop_exec = -1
elsif loop_exec == nil || loop_exec == false || loop_exec == 0
@loop_exec = 1
else
if not loop_exec.kind_of?(Integer)
fail Kernel.format("%s need to be Integer", loop_exec.inspect)
end
@loop_exec = loop_exec
end
@do_loop = @loop_exec
end
self
end
def add_procs(*procs)
procs.each{|e|
if e.kind_of? Proc
@loop_proc.push([e])
else
@loop_proc.push(e)
end
}
@proc_max = @loop_proc.size
self
end
def delete_procs(*procs)
procs.each{|e|
if e.kind_of? Proc
@loop_proc.delete([e])
else
@loop_proc.delete(e)
end
}
@proc_max = @loop_proc.size
cancel if @proc_max == 0
self
end
def delete_at(n)
@loop_proc.delete_at(n)
@proc_max = @loop_proc.size
cancel if @proc_max == 0
self
end
def set_start_proc(sleep, init_proc, *init_args)
if !sleep == 'idle' && !sleep.kind_of?(Integer)
fail Kernel.format("%s need to be Integer", sleep.inspect)
end
@init_sleep = sleep
@init_proc = init_proc
@init_args = init_args
self
end
def start(*init_args)
return nil if @running
Tk_CBTBL[@id] = self
@do_loop = @loop_exec
@current_pos = 0
argc = init_args.size
if argc > 0
sleep = init_args.shift
if !sleep == 'idle' && !sleep.kind_of?(Integer)
fail Kernel.format("%s need to be Integer", sleep.inspect)
end
@init_sleep = sleep
end
@init_proc = init_args.shift if argc > 1
@init_args = init_args if argc > 0
@current_sleep = @init_sleep
@running = true
if @init_proc
if not @init_proc.kind_of? Proc
fail Kernel.format("%s need to be Proc", @init_proc.inspect)
end
@current_proc = @init_proc
set_callback(@init_sleep, @init_args)
@set_next = false if @in_callback
else
set_next_callback(@init_args)
end
self
end
def reset(*reset_args)
restart() if @running
if @init_proc
@return_value = @init_proc.call(self)
else
@return_value = nil
end
@current_pos = 0
@current_args = @init_args
@set_next = false if @in_callback
self
end
def restart(*restart_args)
cancel if @running
if restart_args == []
start(@init_sleep, @init_proc, *@init_args)
else
start(*restart_args)
end
end
def cancel
@running = false
@wait_var.value = 0
tk_call 'after', 'cancel', @after_id if @after_id
@after_id = nil
Tk_CBTBL.delete(@id) ;# for GC
self
end
alias stop cancel
def continue(wait=nil)
fail RuntimeError, "is already running" if @running
sleep, cmd = @current_script
fail RuntimeError, "no procedure to continue" unless cmd
if wait
if not wait.kind_of? Integer
fail RuntimeError, Kernel.format("%s need to be Integer", wait.inspect)
end
sleep = wait
end
Tk_CBTBL[@id] = self
@running = true
@after_id = tk_call('after', sleep, cmd)
self
end
def skip
fail RuntimeError, "is not running now" unless @running
cancel
Tk_CBTBL[@id] = self
@running = true
set_next_callback(@current_args)
self
end
def info
if @after_id
inf = tk_split_list(tk_call('after', 'info', @after_id))
[Tk_CBTBL[inf[0][1]], inf[1]]
else
nil
end
end
def wait(on_thread = true, check_root = false)
if $SAFE >= 4
fail SecurityError, "can't wait timer at $SAFE >= 4"
end
unless @running
if @return_value.kind_of?(Exception)
fail @return_value
else
return @return_value
end
end
@wait_var.wait(on_thread, check_root)
if @return_value.kind_of?(Exception)
fail @return_value
else
@return_value
end
end
def eventloop_wait(check_root = false)
wait(false, check_root)
end
def thread_wait(check_root = false)
wait(true, check_root)
end
def tkwait(on_thread = true)
wait(on_thread, true)
end
def eventloop_tkwait
wait(false, true)
end
def thread_tkwait
wait(true, true)
end
end
TkAfter = TkTimer
require 'tk/timer'

View file

@ -1,29 +1,4 @@
#
# tkbgerror -- bgerror ( tkerror ) module
# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
# tkbgerror.rb - load tk/bgerror.rb
#
require 'tk'
module TkBgError
extend Tk
TkCommandNames = ['bgerror'.freeze].freeze
def bgerror(message)
tk_call 'bgerror', message
end
alias tkerror bgerror
alias show bgerror
module_function :bgerror, :tkerror, :show
def set_handler(hdlr = Proc.new) #==> handler :: proc{|msg| ...body... }
tk_call('proc', 'bgerror', 'msg', install_cmd(hdlr) + ' $msg')
end
def set_default
begin
tk_call('rename', 'bgerror', '')
rescue RuntimeError
end
end
module_function :set_handler, :set_default
end
require 'tk/bgerror'

File diff suppressed because it is too large Load diff

View file

@ -1,28 +1,4 @@
#
# tkconsole.rb : control the console on system without a real console
# tkconsole.rb - load tk/console.rb
#
require 'tk'
module TkConsole
include Tk
extend Tk
TkCommandNames = ['console'.freeze].freeze
def self.title(str=None)
tk_call 'console', str
end
def self.hide
tk_call 'console', 'hide'
end
def self.show
tk_call 'console', 'show'
end
def self.eval(tcl_script)
#
# supports a Tcl script only
# I have no idea to support a Ruby script seamlessly.
#
tk_call 'console', 'eval', tcl_script
end
end
require 'tk/console'

View file

@ -1,276 +1,4 @@
require "tk"
class TkDialog2 < TkWindow
extend Tk
TkCommandNames = ['tk_dialog'.freeze].freeze
def self.show(*args)
dlog = self.new(*args)
dlog.show
dlog
end
def _set_button_config(configs)
set_config = proc{|c,i|
if $VERBOSE && (c.has_key?('command') || c.has_key?(:command))
STDERR.print("Warning: cannot give a command option " +
"to the dialog button#{i}. It was removed.\n")
end
c.delete('command'); c.delete(:command)
@config << Kernel.format("%s.button%s configure %s; ",
@path, i, hash_kv(c).join(' '))
}
case configs
when Proc
@buttons.each_index{|i|
if (c = configs.call(i)).kind_of? Hash
set_config.call(c,i)
end
}
when Array
@buttons.each_index{|i|
if (c = configs[i]).kind_of? Hash
set_config.call(c,i)
end
}
when Hash
@buttons.each_with_index{|s,i|
if (c = configs[s]).kind_of? Hash
set_config.call(c,i)
end
}
end
@config = 'after idle {' + @config + '};' if @config != ""
end
private :_set_button_config
# initialize tk_dialog
def create_self(keys)
@var = TkVariable.new
@title = title
@message = message
@message_config = message_config
@msgframe_config = msgframe_config
@bitmap = bitmap
@bitmap_config = message_config
@default_button = default_button
@buttons = buttons
@button_configs = proc{|num| button_configs(num)}
@btnframe_config = btnframe_config
#@config = "puts [winfo children .w0000];"
@config = ""
@command = nil
if keys.kind_of? Hash
@title = keys['title'] if keys.key? 'title'
@message = keys['message'] if keys.key? 'message'
@bitmap = keys['bitmap'] if keys.key? 'bitmap'
@bitmap = '{}' if @bitmap == nil || @bitmap == ""
@default_button = keys['default'] if keys.key? 'default'
@buttons = keys['buttons'] if keys.key? 'buttons'
@command = keys['prev_command']
@message_config = keys['message_config'] if keys.key? 'message_config'
@msgframe_config = keys['msgframe_config'] if keys.key? 'msgframe_config'
@bitmap_config = keys['bitmap_config'] if keys.key? 'bitmap_config'
@button_configs = keys['button_configs'] if keys.key? 'button_configs'
@btnframe_config = keys['btnframe_config'] if keys.key? 'btnframe_config'
end
if @title.include? ?\s
@title = '{' + @title + '}'
end
if @buttons.kind_of? Array
_set_button_config(@buttons.collect{|cfg|
(cfg.kind_of? Array)? cfg[1]: nil})
@buttons = @buttons.collect{|cfg| (cfg.kind_of? Array)? cfg[0]: cfg}
end
if @buttons.kind_of? Hash
_set_button_config(@buttons)
@buttons = @buttons.keys
end
@buttons = tk_split_simplelist(@buttons) if @buttons.kind_of? String
@buttons = @buttons.collect{|s|
if s.kind_of? Array
s = s.join(' ')
end
if s.include? ?\s
'{' + s + '}'
else
s
end
}
if @message_config.kind_of? Hash
@config << Kernel.format("%s.msg configure %s;",
@path, hash_kv(@message_config).join(' '))
end
if @msgframe_config.kind_of? Hash
@config << Kernel.format("%s.top configure %s;",
@path, hash_kv(@msgframe_config).join(' '))
end
if @btnframe_config.kind_of? Hash
@config << Kernel.format("%s.bot configure %s;",
@path, hash_kv(@btnframe_config).join(' '))
end
if @bitmap_config.kind_of? Hash
@config << Kernel.format("%s.bitmap configure %s;",
@path, hash_kv(@bitmap_config).join(' '))
end
_set_button_config(@button_configs) if @button_configs
if @command.kind_of? Proc
@command.call(self)
end
end
private :create_self
def show
if @default_button.kind_of? String
default_button = @buttons.index(@default_button)
else
default_button = @default_button
end
default_button = '{}' if default_button == nil
Tk.ip_eval('eval {global '+@var.id+';'+@config+
'set '+@var.id+' [tk_dialog '+
@path+" "+@title+" {#{@message}} "+@bitmap+" "+
String(default_button)+" "+@buttons.join(' ')+']}')
end
def value
return @var.value.to_i
end
######################################################
# #
# these methods must be overridden for each dialog #
# #
######################################################
private
def title
# returns a title string of the dialog window
return "DIALOG"
end
def message
# returns a message text to display on the dialog
return "MESSAGE"
end
def message_config
# returns a Hash {option=>value, ...} for the message text
return nil
end
def msgframe_config
# returns a Hash {option=>value, ...} for the message text frame
return nil
end
def bitmap
# returns a bitmap name or a bitmap file path
# (@ + path ; e.g. '@/usr/share/bitmap/sample.xbm')
return "info"
end
def bitmap_config
# returns nil or a Hash {option=>value, ...} for the bitmap
return nil
end
def default_button
# returns a default button's number or name
# if nil or null string, set no-default
return 0
end
def buttons
#return "BUTTON1 BUTTON2"
return ["BUTTON1", "BUTTON2"]
end
def button_configs(num)
# returns nil / Proc / Array or Hash (see _set_button_config)
return nil
end
def btnframe_config
# returns nil or a Hash {option=>value, ...} for the button frame
return nil
end
end
#
# TkDialog : with showing at initialize
# tkdialog.rb - load tk/dialog.rb
#
class TkDialog < TkDialog2
def self.show(*args)
self.new(*args)
end
def initialize(*args)
super(*args)
show
end
end
#
# dialog for warning
#
class TkWarning2 < TkDialog2
def initialize(parent = nil, mes = nil)
if !mes
if parent.kind_of? TkWindow
mes = ""
else
mes = parent.to_s
parent = nil
end
end
super(parent, :message=>mes)
end
def show(mes = nil)
mes_bup = @message
@message = mes if mes
ret = super()
@message = mes_bup
ret
end
#######
private
def title
return "WARNING";
end
def bitmap
return "warning";
end
def default_button
return 0;
end
def buttons
return "OK";
end
end
class TkWarning < TkWarning2
def self.show(*args)
self.new(*args)
end
def initialize(*args)
super(*args)
show
end
end
require 'tk/dialog'

View file

@ -1,292 +1,4 @@
#
# tkentry.rb - Tk entry classes
# $Date$
# by Yukihiro Matsumoto <matz@caelum.co.jp>
require 'tk.rb'
class TkEntry<TkLabel
include Scrollable
TkCommandNames = ['entry'.freeze].freeze
WidgetClassName = 'Entry'.freeze
WidgetClassNames[WidgetClassName] = self
class ValidateCmd
include TkComm
module Action
Insert = 1
Delete = 0
Others = -1
Focus = -1
Forced = -1
Textvariable = -1
TextVariable = -1
end
class ValidateArgs
VARG_KEY = 'disvPSVW'
VARG_TYPE = 'nxeseesw'
def self.scan_args(arg_str, arg_val)
enc = Tk.encoding
arg_cnv = []
arg_str.strip.split(/\s+/).each_with_index{|kwd,idx|
if kwd =~ /^%(.)$/
if num = VARG_KEY.index($1)
case VARG_TYPE[num]
when ?n
arg_cnv << TkComm::number(arg_val[idx])
when ?s
arg_cnv << TkComm::string(arg_val[idx])
when ?e
if enc
arg_cnv << Tk.fromUTF8(TkComm::string(arg_val[idx]), enc)
else
arg_cnv << TkComm::string(arg_val[idx])
end
when ?w
arg_cnv << TkComm::window(arg_val[idx])
when ?x
idx = TkComm::number(arg_val[idx])
if idx < 0
arg_cnv << nil
else
arg_cnv << idx
end
else
arg_cnv << arg_val[idx]
end
else
arg_cnv << arg_val[idx]
end
else
arg_cnv << arg_val[idx]
end
}
arg_cnv
end
def initialize(d,i,s,v,pp,ss,vv,ww)
@action = d
@index = i
@current = s
@type = v
@value = pp
@string = ss
@triggered = vv
@widget = ww
end
attr :action
attr :index
attr :current
attr :type
attr :value
attr :string
attr :triggered
attr :widget
end
def initialize(cmd = Proc.new, args=nil)
if args
@id =
install_cmd(proc{|*arg|
TkUtil.eval_cmd(proc{|*v| (cmd.call(*v))? '1': '0'},
*ValidateArgs.scan_args(args, arg))
}) + " " + args
else
args = ' %d %i %s %v %P %S %V %W'
@id =
install_cmd(proc{|*arg|
TkUtil.eval_cmd(proc{|*v| (cmd.call(*v))? '1': '0'},
ValidateArgs.new(*ValidateArgs \
.scan_args(args,arg)))
}) + args
end
end
def to_eval
@id
end
end
def create_self(keys)
tk_call 'entry', @path
if keys and keys != None
configure(keys)
end
end
private :create_self
def configure(slot, value=None)
if slot.kind_of? Hash
slot = _symbolkey2str(slot)
if slot['vcmd'].kind_of? Array
cmd, *args = slot['vcmd']
slot['vcmd'] = ValidateCmd.new(cmd, args.join(' '))
elsif slot['vcmd'].kind_of? Proc
slot['vcmd'] = ValidateCmd.new(slot['vcmd'])
end
if slot['validatecommand'].kind_of? Array
cmd, *args = slot['validatecommand']
slot['validatecommand'] = ValidateCmd.new(cmd, args.join(' '))
elsif slot['validatecommand'].kind_of? Proc
slot['validatecommand'] = ValidateCmd.new(slot['validatecommand'])
end
if slot['invcmd'].kind_of? Array
cmd, *args = slot['invcmd']
slot['invcmd'] = ValidateCmd.new(cmd, args.join(' '))
elsif slot['invcmd'].kind_of? Proc
slot['invcmd'] = ValidateCmd.new(slot['invcmd'])
end
if slot['invalidcommand'].kind_of? Array
cmd, *args = slot['invalidcommand']
slot['invalidcommand'] = ValidateCmd.new(cmd, args.join(' '))
elsif slot['invalidcommand'].kind_of? Proc
slot['invalidcommand'] = ValidateCmd.new(slot['invalidcommand'])
end
super(slot)
else
if (slot == 'vcmd' || slot == :vcmd ||
slot == 'validatecommand' || slot == :validatecommand ||
slot == 'invcmd' || slot == :invcmd ||
slot == 'invalidcommand' || slot == :invalidcommand)
if value.kind_of? Array
cmd, *args = value
value = ValidateCmd.new(cmd, args.join(' '))
elsif value.kind_of? Proc
value = ValidateCmd.new(value)
end
end
super(slot, value)
end
self
end
def bbox(index)
list(tk_send('bbox', index))
end
def cursor
number(tk_send('index', 'insert'))
end
def cursor=(index)
tk_send 'icursor', index
self
end
def index(index)
number(tk_send('index', index))
end
def insert(pos,text)
tk_send 'insert', pos, text
self
end
def delete(first, last=None)
tk_send 'delete', first, last
self
end
def mark(pos)
tk_send 'scan', 'mark', pos
self
end
def dragto(pos)
tk_send 'scan', 'dragto', pos
self
end
def selection_adjust(index)
tk_send 'selection', 'adjust', index
self
end
def selection_clear
tk_send 'selection', 'clear'
self
end
def selection_from(index)
tk_send 'selection', 'from', index
self
end
def selection_present()
bool(tk_send('selection', 'present'))
end
def selection_range(s, e)
tk_send 'selection', 'range', s, e
self
end
def selection_to(index)
tk_send 'selection', 'to', index
self
end
def invoke_validate
bool(tk_send('validate'))
end
def validate(mode = nil)
if mode
configure 'validate', mode
else
invoke_validate
end
end
def validatecommand(cmd = Proc.new, args = nil)
if cmd.kind_of?(ValidateCmd)
configure('validatecommand', cmd)
elsif args
configure('validatecommand', [cmd, args])
else
configure('validatecommand', cmd)
end
end
alias vcmd validatecommand
def invalidcommand(cmd = Proc.new, args = nil)
if cmd.kind_of?(ValidateCmd)
configure('invalidcommand', cmd)
elsif args
configure('invalidcommand', [cmd, args])
else
configure('invalidcommand', cmd)
end
end
alias invcmd invalidcommand
def value
tk_send 'get'
end
def value= (val)
tk_send 'delete', 0, 'end'
tk_send 'insert', 0, val
end
end
class TkSpinbox<TkEntry
TkCommandNames = ['spinbox'.freeze].freeze
WidgetClassName = 'Spinbox'.freeze
WidgetClassNames[WidgetClassName] = self
def create_self(keys)
tk_call 'spinbox', @path
if keys and keys != None
configure(keys)
end
end
private :create_self
def identify(x, y)
tk_send 'identify', x, y
end
def spinup
tk_send 'invoke', 'spinup'
self
end
def spindown
tk_send 'invoke', 'spindown'
self
end
def set(str)
tk_send 'set', str
end
end
# tkentry.rb - load tk/entry.rb
#
require 'tk/entry'

File diff suppressed because it is too large Load diff

View file

@ -1,56 +1,4 @@
#
# tkmacpkg.rb : methods for Tcl/Tk packages for Macintosh
# 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
# tkmacpkg.rb - load tk/macpkg.rb
#
# ATTENTION !!
# This is NOT TESTED. Because I have no test-environment.
#
#
require 'tk'
module TkMacResource
extend Tk
extend TkMacResource
TkCommandNames = ['resource'.freeze].freeze
tk_call('package', 'require', 'resource')
def close(rsrcRef)
tk_call('resource', 'close', rsrcRef)
end
def delete(rsrcType, opts=nil)
tk_call('resource', 'delete', *(hash_kv(opts) + rsrcType))
end
def files(rsrcRef=nil)
if rsrcRef
tk_call('resource', 'files', rsrcRef)
else
tk_split_simplelist(tk_call('resource', 'files'))
end
end
def list(rsrcType, rsrcRef=nil)
tk_split_simplelist(tk_call('resource', 'list', rsrcType, rsrcRef))
end
def open(fname, access=nil)
tk_call('resource', 'open', fname, access)
end
def read(rsrcType, rsrcID, rsrcRef=nil)
tk_call('resource', 'read', rsrcType, rsrcID, rsrcRef)
end
def types(rsrcRef=nil)
tk_split_simplelist(tk_call('resource', 'types', rsrcRef))
end
def write(rsrcType, data, opts=nil)
tk_call('resource', 'write', *(hash_kv(opts) + rsrcType + data))
end
module_function :close, :delete, :files, :list, :open, :read, :types, :write
end
require 'tk/macpkg'

View file

@ -1,143 +1,4 @@
#
# tkmenubar.rb
# tkmenubar.rb - load tk/menubar.rb
#
# Copyright (C) 1998 maeda shugo. All rights reserved.
# This file can be distributed under the terms of the Ruby.
# Usage:
#
# menu_spec = [
# [['File', 0],
# ['Open', proc{puts('Open clicked')}, 0],
# '---',
# ['Quit', proc{exit}, 0]],
# [['Edit', 0],
# ['Cut', proc{puts('Cut clicked')}, 2],
# ['Copy', proc{puts('Copy clicked')}, 0],
# ['Paste', proc{puts('Paste clicked')}, 0]]
# ]
# menubar = TkMenubar.new(nil, menu_spec,
# 'tearoff'=>false,
# 'foreground'=>'grey40',
# 'activeforeground'=>'red',
# 'font'=>'-adobe-helvetica-bold-r-*--12-*-iso8859-1')
# menubar.pack('side'=>'top', 'fill'=>'x')
#
#
# OR
#
#
# menubar = TkMenubar.new
# menubar.add_menu([['File', 0],
# ['Open', proc{puts('Open clicked')}, 0],
# '---',
# ['Quit', proc{exit}, 0]])
# menubar.add_menu([['Edit', 0],
# ['Cut', proc{puts('Cut clicked')}, 2],
# ['Copy', proc{puts('Copy clicked')}, 0],
# ['Paste', proc{puts('Paste clicked')}, 0]])
# menubar.configure('tearoff', false)
# menubar.configure('foreground', 'grey40')
# menubar.configure('activeforeground', 'red')
# menubar.configure('font', '-adobe-helvetica-bold-r-*--12-*-iso8859-1')
# menubar.pack('side'=>'top', 'fill'=>'x')
# The format of the menu_spec is:
# [
# [
# [button text, underline, accelerator],
# [menu label, command, underline, accelerator],
# '---', # separator
# ...
# ],
# ...
# ]
# underline and accelerator are optional parameters.
# Hashes are OK instead of Arrays.
# To use add_menu, configuration must be done by calling configure after
# adding all menus by add_menu, not by the constructor arguments.
require "tk"
class TkMenubar<TkFrame
include TkComposite
def initialize(parent = nil, spec = nil, options = nil)
if parent.kind_of? Hash
options = _symbolkey2str(parent)
spec = options.delete('spec')
super(options)
else
super(parent, options)
end
@menus = []
if spec
for menu_info in spec
add_menu(menu_info)
end
end
if options
for key, value in options
configure(key, value)
end
end
end
def add_menu(menu_info)
btn_info = menu_info.shift
mbtn = TkMenubutton.new(@frame)
if btn_info.kind_of?(Hash)
for key, value in btn_info
mbtn.configure(key, value)
end
elsif btn_info.kind_of?(Array)
mbtn.configure('text', btn_info[0]) if btn_info[0]
mbtn.configure('underline', btn_info[1]) if btn_info[1]
mbtn.configure('accelerator', btn_info[2]) if btn_info[2]
else
mbtn.configure('text', btn_info)
end
menu = TkMenu.new(mbtn)
for item_info in menu_info
if item_info.kind_of?(Hash)
menu.add('command', item_info)
elsif item_info.kind_of?(Array)
options = {}
options['label'] = item_info[0] if item_info[0]
options['command'] = item_info[1] if item_info[1]
options['underline'] = item_info[2] if item_info[2]
options['accelerator'] = item_info[3] if item_info[3]
menu.add('command', options)
elsif /^-+$/ =~ item_info
menu.add('sep')
else
menu.add('command', 'label' => item_info)
end
end
mbtn.menu(menu)
@menus.push([mbtn, menu])
delegate('tearoff', menu)
delegate('foreground', mbtn, menu)
delegate('background', mbtn, menu)
delegate('disabledforeground', mbtn, menu)
delegate('activeforeground', mbtn, menu)
delegate('activebackground', mbtn, menu)
delegate('font', mbtn, menu)
delegate('kanjifont', mbtn, menu)
mbtn.pack('side' => 'left')
end
def [](index)
return @menus[index]
end
end
require 'tk/menubar'

View file

@ -1,33 +1,4 @@
#
# tkmngfocus.rb : methods for Tcl/Tk standard library 'focus.tcl'
# by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
# tkmngfocus.rb - load tk/mngfocus.rb
#
require 'tk'
module TkManageFocus
extend Tk
TkCommandNames = [
'tk_focusFollowMouse'.freeze,
'tk_focusNext'.freeze,
'tk_focusPrev'.freeze
].freeze
def TkManageFocus.followsMouse
tk_call 'tk_focusFollowsMouse'
end
def TkManageFocus.next(window)
tk_tcl2ruby(tk_call('tk_focusNext', window))
end
def focusNext
TkManageFocus.next(self)
end
def TkManageFocus.prev(window)
tk_tcl2ruby(tk_call('tk_focusPrev', window))
end
def focusPrev
TkManageFocus.prev(self)
end
end
require 'tk/mngfocus'

View file

@ -1,54 +1,4 @@
#
# tkpalette.rb : methods for Tcl/Tk standard library 'palette.tcl'
# 1998/06/21 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
# tkpalette.rb - load tk/palette.rb
#
require 'tk'
module TkPalette
include Tk
extend Tk
TkCommandNames = [
'tk_setPalette'.freeze,
'tk_bisque'.freeze,
'tkDarken'.freeze
].freeze
def TkPalette.set(*args)
args = args.to_a.flatten if args.kind_of? Hash
tk_call 'tk_setPalette', *args
end
def TkPalette.setPalette(*args)
TkPalette.set(*args)
end
def TkPalette.bisque
tk_call 'tk_bisque'
end
def TkPalette.darken(color, percent)
tk_call 'tkDarken', color, percent
end
def TkPalette.recolorTree(window, colors)
if not colors.kind_of?(Hash)
fail "2nd arg need to be Hash"
end
colors.each{|key, value|
begin
if window.cget(key) == tk_call('set', "tkPalette(#{key})")
window[key] = colors[key]
end
rescue
# ignore
end
}
TkWinfo.children(window).each{|w| TkPalette.recolorTree(w, colors)}
end
def recolorTree(colors)
TkPalette.recolorTree(self, colors)
end
end
require 'tk/palette'

View file

@ -1,30 +1,4 @@
#
# tkscrollbox.rb - Tk Listbox with Scrollbar
# as an example of Composite Widget
# $Date$
# by Yukihiro Matsumoto <matz@netlab.co.jp>
require 'tk.rb'
class TkScrollbox<TkListbox
include TkComposite
def initialize_composite(keys=nil)
list = TkListbox.new(@frame)
scroll = TkScrollbar.new(@frame)
@path = list.path
list.configure 'yscroll', scroll.path+" set"
list.pack 'side'=>'left','fill'=>'both','expand'=>'yes'
scroll.configure 'command', list.path+" yview"
scroll.pack 'side'=>'right','fill'=>'y'
delegate('DEFAULT', list)
delegate('foreground', list)
delegate('background', list, scroll)
delegate('borderwidth', @frame)
delegate('relief', @frame)
configure keys if keys
end
private :initialize_composite
end
# tkscrollbox.rb - load tk/scrollbox.rb
#
require 'tk/scrollbox'

File diff suppressed because it is too large Load diff

View file

@ -1,85 +1,4 @@
#
# tkvirtevent.rb : treats virtual events
# 1998/07/16 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
# tkvirtevent.rb - load tk/virtevent.rb
#
require 'tk'
class TkVirtualEvent<TkObject
extend Tk
TkCommandNames = ['event'.freeze].freeze
TkVirtualEventID = ["<VirtEvent".freeze, "00000".taint, ">".freeze].freeze
TkVirtualEventTBL = TkCore::INTERP.create_table
TkCore::INTERP.init_ip_env{ TkVirtualEventTBL.clear }
class PreDefVirtEvent<self
def initialize(event)
@path = @id = event
TkVirtualEvent::TkVirtualEventTBL[@id] = self
end
end
def TkVirtualEvent.getobj(event)
obj = TkVirtualEventTBL[event]
if obj
obj
else
if tk_call('event', 'info').index("<#{event}>")
PreDefVirtEvent.new(event)
else
fail ArgumentError, "undefined virtual event '<#{event}>'"
end
end
end
def TkVirtualEvent.info
tk_call('event', 'info').split(/\s+/).collect!{|seq|
TkVirtualEvent.getobj(seq[1..-2])
}
end
def initialize(*sequences)
@path = @id = TkVirtualEventID.join
TkVirtualEventID[1].succ!
add(*sequences)
end
def add(*sequences)
if sequences != []
tk_call('event', 'add', "<#{@id}>",
*(sequences.collect{|seq| "<#{tk_event_sequence(seq)}>"}) )
TkVirtualEventTBL[@id] = self
end
self
end
def delete(*sequences)
if sequences == []
tk_call('event', 'delete', "<#{@id}>")
TkVirtualEventTBL.delete(@id)
else
tk_call('event', 'delete', "<#{@id}>",
*(sequences.collect{|seq| "<#{tk_event_sequence(seq)}>"}) )
TkVirtualEventTBL.delete(@id) if info == []
end
self
end
def info
tk_call('event', 'info', "<#{@id}>").split(/\s+/).collect!{|seq|
l = seq.scan(/<*[^<>]+>*/).collect!{|subseq|
case (subseq)
when /^<<[^<>]+>>$/
TkVirtualEvent.getobj(subseq[1..-2])
when /^<[^<>]+>$/
subseq[1..-2]
else
subseq.split('')
end
}.flatten
(l.size == 1) ? l[0] : l
}
end
end
require 'tk/virtevent'

View file

@ -1,84 +1,4 @@
#
# tkwinpkg.rb : methods for Tcl/Tk packages for Microsoft Windows
# 2000/11/22 by Hidetoshi Nagai <nagai@ai.kyutech.ac.jp>
# tkwinpkg.rb - load tk/winpkg.rb
#
# ATTENTION !!
# This is NOT TESTED. Because I have no test-environment.
#
#
require 'tk'
module TkWinDDE
extend Tk
extend TkWinDDE
TkCommandNames = ['dde'.freeze].freeze
tk_call('package', 'require', 'dde')
def servername(topic=nil)
tk_call('dde', 'servername', topic)
end
def execute(service, topic, data)
tk_call('dde', 'execute', service, topic, data)
end
def async_execute(service, topic, data)
tk_call('dde', '-async', 'execute', service, topic, data)
end
def poke(service, topic, item, data)
tk_call('dde', 'poke', service, topic, item, data)
end
def request(service, topic, item)
tk_call('dde', 'request', service, topic, item)
end
def services(service, topic)
tk_call('dde', 'services', service, topic)
end
def eval(topic, cmd, *args)
tk_call('dde', 'eval', topic, cmd, *args)
end
module_function :servername, :execute, :async_execute,
:poke, :request, :services, :eval
end
module TkWinRegistry
extend Tk
extend TkWinRegistry
TkCommandNames = ['registry'.freeze].freeze
tk_call('package', 'require', 'registry')
def delete(keynam, valnam=nil)
tk_call('registry', 'delete', keynam, valnam)
end
def get(keynam, valnam)
tk_call('registry', 'get', keynam, valnam)
end
def keys(keynam)
tk_split_simplelist(tk_call('registry', 'keys', keynam))
end
def set(keynam, valnam=nil, data=nil, dattype=nil)
tk_call('registry', 'set', keynam, valnam, data, dattype)
end
def type(keynam, valnam)
tk_call('registry', 'type', keynam, valnam)
end
def values(keynam)
tk_split_simplelist(tk_call('registry', 'values', keynam))
end
module_function :delete, :get, :keys, :set, :type, :values
end
require 'tk/winpkg'

View file

@ -1,3 +1,8 @@
This is a original document of 'tkencoding.rb'.
The library 'tkencoding.rb' is obsolete.
Functions of tkencoding.rb is already included into Ruby/Tk.
-------------------------------------------------
tkencoding.rbを用いた日本語の表示について
Copyright (C) 1999/07, Takaaki Tateishi <ttate@jaist.ac.jp>

View file

@ -150,7 +150,7 @@ if TkWinfo.depth($arrow_canvas) > 1
$demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1}
else
$demo_arrowInfo.bigLineStyle = {'fill'=>'black',
'stipple'=>'@'+[$demo_dir, 'images', 'grey.25'].join(File::Separator)}
'stipple'=>'@'+[$demo_dir,'..','images','grey.25'].join(File::Separator)}
$demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1}
$demo_arrowInfo.activeStyle = {'fill'=>'black','outline'=>'black','width'=>1}
end

View file

@ -67,7 +67,7 @@ TkText.new($bind_demo){|t|
tagstyle_normal = {'foreground'=>'', 'background'=>''}
end
# テキスト挿入
# insert text
insert 'insert', "The same tag mechanism that controls display styles in text widgets can also be used to associate Tcl commands with regions of text, so that mouse or keyboard actions on the text cause particular Tcl commands to be invoked. For example, in the text below the descriptions of the canvas demonstrations have been tagged. When you move the mouse over a demo description the description lights up, and when you press button 1 over a description then that particular demonstration is invoked.
"

View file

@ -39,11 +39,11 @@ class Browse
}
# Set up bindings for the browser.
base.bind('Control-c',
proc{
base.destroy
base.bind('Destroy', proc{
Browse::BROWSE_WIN_COUNTER.value = \
Browse::BROWSE_WIN_COUNTER.to_i - 1})
Browse::BROWSE_WIN_COUNTER.to_i - 1
})
base.bind('Control-c', proc{base.destroy})
list.bind('Double-Button-1',
proc{TkSelection.get.each{|f| self.browse dir, f}})
end

View file

@ -52,7 +52,7 @@ unless $tk_version =~ /^4\.[01]/
TkGrid.columnconfigure($cscroll_grid, 0, 'weight'=>1, 'minsize'=>0)
end
# canvas 肋年
# canvas
$cscroll_canvas = TkCanvas.new($cscroll_demo,
'relief'=>'sunken', 'borderwidth'=>2,
'scrollregion'=>['-11c', '-11c', '50c', '20c']

View file

@ -22,7 +22,7 @@ class TkDialog_Demo1 < TkDialog
end
def buttons
["Dismiss", "", "Show Code"]
# ["Dismiss", "", "Show Code"]
["OK", "Cancel", "Show Code"]
end
end

View file

@ -158,6 +158,8 @@ def validatePhoneChange(widget, vmode, idx, char)
widget.insert(idx, $phoneNumberMap[char] || char)
Tk.after_idle(proc{phoneSkipRight(widget, -1)})
return true
# Tk.update(true) # Don't work 'update' inter validation callback.
# It depends on Tcl/Tk side (tested on Tcl/Tk8.5a1).
end
return false
end

View file

@ -48,30 +48,33 @@ TkFrame.new($icon_demo) {|frame|
# image
flagup = \
TkBitmapImage.new('file'=>[$demo_dir,
TkBitmapImage.new('file'=>[$demo_dir,'..',
'images','flagup.xbm'].join(File::Separator),
'maskfile'=>\
[$demo_dir,'images','flagup.xbm'].join(File::Separator))
[$demo_dir,'..','images','flagup.xbm'].join(File::Separator))
flagdown = \
TkBitmapImage.new('file'=>[$demo_dir,
TkBitmapImage.new('file'=>[$demo_dir,'..',
'images','flagdown.xbm'].join(File::Separator),
'maskfile'=>\
[$demo_dir,'images','flagdown.xbm'].join(File::Separator))
[$demo_dir,'..',
'images','flagdown.xbm'].join(File::Separator))
# ÊÑ¿ôÀ¸À®
# create variable
letters = TkVariable.new
# frame
TkFrame.new($icon_demo, 'borderwidth'=>10){|w|
TkFrame.new(w) {|f|
TkRadioButton.new(f){
bitmap '@' + [$demo_dir,'images','letters.xbm'].join(File::Separator)
bitmap '@' + [$demo_dir,'..',
'images','letters.xbm'].join(File::Separator)
variable letters
value 'full'
}.pack('side'=>'top', 'expand'=>'yes')
TkRadioButton.new(f){
bitmap '@' + [$demo_dir,'images','noletter.xbm'].join(File::Separator)
bitmap '@' + [$demo_dir,'..',
'images','noletter.xbm'].join(File::Separator)
variable letters
value 'empty'
}.pack('side'=>'top', 'expand'=>'yes')
@ -86,7 +89,8 @@ TkFrame.new($icon_demo, 'borderwidth'=>10){|w|
}.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
TkCheckButton.new(w) {
bitmap '@' + [$demo_dir,'images','letters.xbm'].join(File::Separator)
bitmap '@' + [$demo_dir,'..',
'images','letters.xbm'].join(File::Separator)
indicatoron 0
selectcolor 'SeaGreen1'
}.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')

View file

@ -47,10 +47,10 @@ TkFrame.new($image1_demo) {|frame|
# image
image1a = \
TkPhotoImage.new('file'=>[$demo_dir,
TkPhotoImage.new('file'=>[$demo_dir,'..',
'images','earth.gif'].join(File::Separator))
image1b = \
TkPhotoImage.new('file'=>[$demo_dir,
TkPhotoImage.new('file'=>[$demo_dir,'..',
'images','earthris.gif'].join(File::Separator))
# label

View file

@ -46,8 +46,8 @@ TkFrame.new($image2_demo) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# 揀웃으윙
$dirName = TkVariable.new([$demo_dir,'images'].join(File::Separator))
# create variable
$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
# image
$image2a = TkPhotoImage.new

View file

@ -75,7 +75,7 @@ TkFrame.new($image3_demo) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# variable
$dirName = TkVariable.new([$demo_dir,'images'].join(File::Separator))
$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
# image
begin

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View file

@ -1,173 +0,0 @@
#define face_width 108
#define face_height 144
#define face_x_hot 48
#define face_y_hot 80
static char face_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09,
0x20, 0x80, 0x24, 0x05, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x88,
0x24, 0x20, 0x80, 0x24, 0x00, 0x00, 0x00, 0x10, 0x80, 0x04, 0x00, 0x01,
0x00, 0x01, 0x40, 0x0a, 0x09, 0x00, 0x92, 0x04, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x10, 0x40, 0x12, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x84,
0x24, 0x40, 0x22, 0xa8, 0x02, 0x14, 0x84, 0x92, 0x40, 0x42, 0x12, 0x04,
0x10, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x11, 0x00, 0x12, 0x00,
0x40, 0x02, 0x00, 0x20, 0x00, 0x08, 0x00, 0xaa, 0x02, 0x54, 0x85, 0x24,
0x00, 0x10, 0x12, 0x00, 0x00, 0x81, 0x44, 0x00, 0x90, 0x5a, 0x00, 0xea,
0x1b, 0x00, 0x80, 0x40, 0x40, 0x02, 0x00, 0x08, 0x00, 0x20, 0xa2, 0x05,
0x8a, 0xb4, 0x6e, 0x45, 0x12, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02,
0xa8, 0x92, 0x00, 0xda, 0x5f, 0x10, 0x00, 0x10, 0xa1, 0x04, 0x20, 0x41,
0x02, 0x00, 0x5a, 0x25, 0xa0, 0xff, 0xfb, 0x05, 0x41, 0x02, 0x04, 0x00,
0x00, 0x08, 0x40, 0x80, 0xec, 0x9b, 0xec, 0xfe, 0x7f, 0x01, 0x04, 0x20,
0x90, 0x02, 0x04, 0x00, 0x08, 0x20, 0xfb, 0x2e, 0xf5, 0xff, 0xff, 0x57,
0x00, 0x04, 0x02, 0x00, 0x00, 0x20, 0x01, 0xc1, 0x6e, 0xab, 0xfa, 0xff,
0xff, 0x05, 0x90, 0x20, 0x48, 0x02, 0x00, 0x04, 0x20, 0xa8, 0xdf, 0xb5,
0xfe, 0xff, 0xff, 0x0b, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x04, 0xe0,
0xbb, 0xef, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x04, 0x48, 0x02, 0x00, 0x20,
0x80, 0xf4, 0x6f, 0xfb, 0xff, 0xff, 0xff, 0x20, 0x90, 0x40, 0x02, 0x00,
0x00, 0x04, 0x08, 0xb8, 0xf6, 0xff, 0xff, 0xdf, 0xbe, 0x12, 0x45, 0x10,
0x90, 0x04, 0x90, 0x00, 0x22, 0xfa, 0xff, 0xff, 0xff, 0xbb, 0xd7, 0xe9,
0x3a, 0x02, 0x02, 0x00, 0x04, 0x90, 0x80, 0xfe, 0xdf, 0xf6, 0xb7, 0xef,
0xbe, 0x56, 0x57, 0x40, 0x48, 0x09, 0x00, 0x04, 0x00, 0xfa, 0xf5, 0xdf,
0xed, 0x5a, 0xd5, 0xea, 0xbd, 0x09, 0x00, 0x00, 0x40, 0x00, 0x92, 0xfe,
0xbf, 0x7d, 0xb7, 0x6a, 0x55, 0xbf, 0xf7, 0x02, 0x11, 0x01, 0x00, 0x91,
0x00, 0xff, 0xff, 0xaf, 0x55, 0x55, 0x5b, 0xeb, 0xef, 0x22, 0x04, 0x04,
0x04, 0x00, 0xa4, 0xff, 0xf7, 0xad, 0xaa, 0xaa, 0xaa, 0xbe, 0xfe, 0x03,
0x20, 0x00, 0x10, 0x44, 0x80, 0xff, 0x7f, 0x55, 0x12, 0x91, 0x2a, 0xeb,
0xbf, 0x0b, 0x82, 0x02, 0x00, 0x00, 0xd1, 0x7f, 0xdf, 0xa2, 0xa4, 0x54,
0x55, 0xfd, 0xfd, 0x47, 0x08, 0x08, 0x00, 0x21, 0xe4, 0xff, 0x37, 0x11,
0x09, 0xa5, 0xaa, 0xb6, 0xff, 0x0d, 0x80, 0x00, 0x00, 0x04, 0xd0, 0xff,
0x4f, 0x44, 0x20, 0x48, 0x55, 0xfb, 0xff, 0x27, 0x11, 0x02, 0x40, 0x40,
0xe2, 0xfb, 0x15, 0x11, 0x4a, 0x55, 0x4a, 0x7d, 0xf7, 0x0f, 0x00, 0x00,
0x04, 0x08, 0xf8, 0xdf, 0x52, 0x44, 0x01, 0x52, 0xb5, 0xfa, 0xff, 0x0f,
0x49, 0x02, 0x00, 0x02, 0xe9, 0xf6, 0x0a, 0x11, 0xa4, 0x88, 0x4a, 0x6d,
0xff, 0x5f, 0x00, 0x00, 0x10, 0x20, 0xf0, 0x2f, 0x21, 0x44, 0x10, 0x52,
0xb5, 0xfa, 0xff, 0x0f, 0x44, 0x04, 0x80, 0x08, 0xf8, 0xab, 0x8a, 0x00,
0x81, 0xa4, 0xd4, 0xd6, 0xfe, 0x2f, 0x00, 0x00, 0x04, 0x40, 0xb5, 0x2d,
0x21, 0x08, 0x04, 0x90, 0xaa, 0xfa, 0xff, 0x1f, 0x11, 0x01, 0x00, 0x04,
0xf0, 0x57, 0x0a, 0x22, 0x40, 0x4a, 0xda, 0x5e, 0xfb, 0x1f, 0x40, 0x00,
0x40, 0x20, 0xba, 0x95, 0x90, 0x00, 0x01, 0xa0, 0xaa, 0xea, 0xff, 0x5f,
0x02, 0x02, 0x00, 0x01, 0xe8, 0x57, 0x05, 0x00, 0x00, 0x12, 0xd5, 0xfe,
0xfd, 0x1f, 0x48, 0x00, 0x04, 0x48, 0x7a, 0x95, 0x08, 0x02, 0x10, 0x40,
0xaa, 0x55, 0xf7, 0x1f, 0x00, 0x09, 0x20, 0x00, 0xf8, 0x57, 0x22, 0x10,
0x00, 0x28, 0xa9, 0xfa, 0xff, 0x5f, 0x02, 0x00, 0x00, 0x49, 0xdd, 0x29,
0x01, 0x00, 0x80, 0x80, 0xaa, 0xd7, 0xff, 0x0f, 0x10, 0x00, 0x08, 0x00,
0xf8, 0x96, 0x08, 0x00, 0x00, 0x20, 0x54, 0xfa, 0xee, 0x3f, 0x81, 0x04,
0x40, 0x24, 0xfe, 0x55, 0x82, 0x00, 0x00, 0x82, 0xd2, 0xad, 0xff, 0x0f,
0x08, 0x00, 0x04, 0x80, 0x6c, 0x97, 0x00, 0x00, 0x02, 0x20, 0xa9, 0xf6,
0xdf, 0x5f, 0x00, 0x02, 0x20, 0x09, 0xfa, 0x49, 0x12, 0x00, 0x20, 0x84,
0x54, 0xdb, 0xfe, 0x1f, 0x91, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x00, 0x20,
0x00, 0x40, 0xa4, 0xf6, 0xbb, 0x1f, 0x04, 0x00, 0x44, 0x92, 0x7e, 0x95,
0x02, 0x00, 0x00, 0x89, 0xaa, 0xdd, 0xff, 0x1f, 0x20, 0x09, 0x10, 0x00,
0xf4, 0x57, 0x20, 0x01, 0x08, 0x20, 0xa9, 0x76, 0xff, 0x5f, 0x02, 0x00,
0x00, 0x21, 0xfc, 0x4a, 0x05, 0x00, 0x01, 0x80, 0x54, 0xdb, 0xff, 0x1e,
0x08, 0x02, 0x04, 0x08, 0xf9, 0x2b, 0x00, 0x00, 0x40, 0x28, 0xd2, 0xf6,
0xff, 0xbf, 0x80, 0x00, 0x90, 0x00, 0xbc, 0x92, 0x08, 0x10, 0x00, 0x82,
0x54, 0xdb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x44, 0xf9, 0x55, 0x02, 0x01,
0x00, 0x20, 0xaa, 0xbd, 0xfd, 0x3f, 0x08, 0x04, 0x04, 0x10, 0xf4, 0x2a,
0x01, 0x00, 0x22, 0x80, 0xd4, 0xf6, 0xff, 0x5f, 0x82, 0x00, 0x40, 0x02,
0xf8, 0x55, 0x20, 0x00, 0x00, 0x50, 0x6a, 0xdf, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x48, 0xe9, 0x4a, 0x05, 0x08, 0x00, 0xa5, 0xd5, 0xf5, 0xff, 0x3f,
0x10, 0x01, 0x10, 0x01, 0xb0, 0xab, 0x92, 0x02, 0x40, 0xf8, 0xbf, 0xde,
0xfe, 0x5f, 0x02, 0x04, 0x04, 0x48, 0xfa, 0xd4, 0x6f, 0x20, 0x84, 0xef,
0xff, 0xfb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x00, 0xe0, 0xed, 0xbf, 0x0b,
0xa1, 0x7e, 0xff, 0xbf, 0xfd, 0x5f, 0x04, 0x01, 0x20, 0x49, 0xd2, 0xfb,
0xfe, 0x55, 0xd4, 0xff, 0xff, 0xf6, 0xff, 0x07, 0x00, 0x04, 0x00, 0x00,
0xc0, 0xaa, 0xfb, 0x2b, 0xa2, 0xfe, 0xff, 0xdf, 0xee, 0x1f, 0x91, 0x00,
0x82, 0xa4, 0xa4, 0xf5, 0xff, 0x57, 0xd5, 0xff, 0xbf, 0xfd, 0xff, 0x4d,
0x00, 0x00, 0x20, 0x00, 0x88, 0x5b, 0xff, 0x2f, 0x69, 0xff, 0xff, 0xdb,
0xfe, 0x1f, 0x24, 0x02, 0x00, 0x49, 0xa2, 0xd6, 0xff, 0x5f, 0xea, 0xff,
0x7f, 0x7f, 0x7f, 0x0d, 0x00, 0x00, 0x10, 0x00, 0x40, 0xab, 0xf7, 0xbb,
0xf0, 0xdf, 0xff, 0xd5, 0xff, 0xbf, 0x82, 0x04, 0x42, 0x24, 0x91, 0xd5,
0xaa, 0xae, 0xd4, 0xaa, 0x52, 0x7b, 0xff, 0x15, 0x08, 0x00, 0x00, 0x01,
0x04, 0x55, 0xd5, 0x55, 0x70, 0x5b, 0x75, 0xdd, 0xdf, 0x1f, 0x40, 0x00,
0x08, 0x48, 0xa0, 0x4a, 0xa9, 0x56, 0xea, 0x56, 0xad, 0x6a, 0x7d, 0x9b,
0x04, 0x01, 0x00, 0x02, 0x42, 0x2a, 0xd5, 0xaa, 0xa8, 0xaa, 0xaa, 0xfa,
0xdf, 0x2f, 0x10, 0x04, 0x22, 0x48, 0x08, 0x45, 0x2a, 0x15, 0x68, 0x55,
0x55, 0xd7, 0x76, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x40, 0x2a, 0x80, 0xa0,
0xb2, 0x09, 0x48, 0xb9, 0xdf, 0x17, 0x22, 0x01, 0x00, 0x24, 0x45, 0x8a,
0x24, 0x4a, 0x54, 0x51, 0x91, 0xf6, 0x6e, 0x4b, 0x00, 0x04, 0x90, 0x00,
0x80, 0x52, 0x00, 0x20, 0x69, 0x05, 0xa4, 0xaa, 0xff, 0x1e, 0x48, 0x00,
0x02, 0x92, 0x08, 0x05, 0x81, 0x94, 0xd4, 0x92, 0x40, 0xfd, 0xb6, 0x8b,
0x00, 0x01, 0x40, 0x00, 0x82, 0x54, 0x00, 0x48, 0x68, 0x05, 0x90, 0xa4,
0xef, 0x06, 0x24, 0x00, 0x08, 0x12, 0x10, 0x05, 0x00, 0x10, 0xb5, 0x01,
0x42, 0xfb, 0xbf, 0x43, 0x00, 0x09, 0x00, 0x40, 0x81, 0xa8, 0x08, 0x4a,
0xaa, 0x96, 0x90, 0xac, 0x6d, 0x15, 0x22, 0x00, 0x20, 0x09, 0x04, 0x15,
0x80, 0x28, 0xdc, 0x01, 0x24, 0xfb, 0xbf, 0x01, 0x80, 0x04, 0x09, 0x00,
0x40, 0x48, 0x02, 0x45, 0xb2, 0x2e, 0x41, 0x6d, 0xef, 0x05, 0x11, 0x00,
0x40, 0x52, 0x02, 0x15, 0x29, 0x2a, 0xac, 0x42, 0x54, 0xfb, 0x3b, 0x51,
0x84, 0x00, 0x08, 0x00, 0x20, 0x54, 0x80, 0x05, 0xb5, 0x3d, 0xa2, 0xb6,
0xdf, 0x00, 0x20, 0x04, 0x20, 0x49, 0x89, 0xa8, 0x6a, 0x29, 0xac, 0xd6,
0x54, 0xff, 0x3f, 0x84, 0x00, 0x01, 0x04, 0x10, 0x00, 0x94, 0xa8, 0x56,
0xda, 0x5f, 0xab, 0xd5, 0x1e, 0x10, 0x48, 0x00, 0x90, 0x82, 0x48, 0xa8,
0xb2, 0xac, 0xfd, 0x55, 0xd5, 0xfe, 0x9f, 0x80, 0x00, 0x0a, 0x02, 0x08,
0x02, 0x55, 0x5a, 0x75, 0xff, 0xaf, 0xb6, 0xf7, 0x2d, 0x12, 0x92, 0x00,
0x10, 0x20, 0x10, 0xa8, 0x54, 0xd5, 0xbf, 0x5d, 0xad, 0xdd, 0x0f, 0x00,
0x00, 0x04, 0x40, 0x09, 0x84, 0xa8, 0xaa, 0x5a, 0xed, 0xeb, 0x6a, 0xff,
0x9f, 0xa4, 0x24, 0x01, 0x02, 0xa0, 0x20, 0x50, 0x55, 0xd5, 0xbe, 0xae,
0xad, 0xfd, 0x16, 0x00, 0x10, 0x04, 0x20, 0x0a, 0x08, 0xb4, 0xaa, 0x95,
0xaa, 0x7b, 0xb7, 0xdb, 0x5f, 0x92, 0x04, 0x01, 0x84, 0x20, 0x21, 0x51,
0xd5, 0x2a, 0xa9, 0xee, 0xd5, 0xfe, 0x0d, 0x00, 0x20, 0x04, 0x10, 0x00,
0x08, 0x50, 0xe9, 0xd7, 0xd4, 0xfb, 0xb5, 0xff, 0x9f, 0x24, 0x09, 0x01,
0x42, 0x4a, 0xa2, 0x64, 0xd5, 0x55, 0x7b, 0x7f, 0xda, 0x7d, 0x4f, 0x00,
0x20, 0x04, 0x00, 0x80, 0x00, 0xa0, 0x2a, 0x13, 0x84, 0x6a, 0x55, 0xff,
0x1d, 0x48, 0x8a, 0x00, 0x94, 0x24, 0x8a, 0xc8, 0xaa, 0x42, 0x20, 0x5d,
0xf5, 0xff, 0x5f, 0x01, 0x00, 0x02, 0x01, 0x00, 0x20, 0xa2, 0x4a, 0x1a,
0x82, 0x56, 0xda, 0xbd, 0x3f, 0x92, 0x92, 0x00, 0x90, 0x92, 0x00, 0x40,
0x95, 0x6a, 0xf4, 0x55, 0x6d, 0xff, 0xd6, 0x00, 0x00, 0x0a, 0x04, 0x20,
0x14, 0x49, 0x4b, 0xaa, 0xaa, 0x56, 0xf5, 0xff, 0xbf, 0xab, 0xa4, 0x00,
0x20, 0x89, 0x40, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xde, 0xbf, 0xeb, 0x03,
0x00, 0x02, 0x04, 0x02, 0x0a, 0x10, 0x2b, 0x2a, 0x55, 0x5b, 0xf5, 0xff,
0xd7, 0x2f, 0x92, 0x00, 0x10, 0x28, 0x21, 0x01, 0x56, 0x95, 0xa0, 0x56,
0xdf, 0xef, 0xea, 0x87, 0x40, 0x0a, 0x42, 0x41, 0x00, 0x90, 0xaa, 0x52,
0xb6, 0xad, 0xfa, 0xff, 0xd5, 0x2f, 0x14, 0x00, 0x00, 0x04, 0x95, 0x04,
0xaa, 0xac, 0x55, 0x6b, 0xff, 0xb7, 0xea, 0x9f, 0x40, 0x02, 0x28, 0x51,
0x00, 0x40, 0x58, 0xd5, 0xda, 0xd6, 0x6e, 0x7f, 0xf9, 0x3f, 0x12, 0x04,
0x02, 0x04, 0x49, 0x25, 0x55, 0xaa, 0x77, 0xab, 0xff, 0x2b, 0xfd, 0x3f,
0x48, 0x01, 0x20, 0x41, 0x00, 0x00, 0x58, 0xa9, 0xda, 0xea, 0xfd, 0xaf,
0xfa, 0xff, 0x02, 0x04, 0x08, 0x14, 0x29, 0x49, 0x52, 0x55, 0x55, 0x55,
0xff, 0x8d, 0xfe, 0x3f, 0xa8, 0x00, 0x02, 0x41, 0x00, 0x02, 0xa0, 0xa2,
0xaa, 0xea, 0xff, 0x53, 0xfd, 0xff, 0x02, 0x04, 0x50, 0x04, 0x25, 0xa8,
0x54, 0x49, 0x52, 0xb5, 0xbf, 0x8a, 0xfe, 0xff, 0xa9, 0x08, 0x04, 0x50,
0x80, 0x02, 0xa1, 0x2a, 0x95, 0xea, 0xff, 0xa1, 0xff, 0xff, 0x03, 0x02,
0x90, 0x02, 0x09, 0x08, 0x44, 0x49, 0x52, 0xbd, 0x7f, 0xca, 0xff, 0xff,
0x2b, 0x09, 0x04, 0x48, 0x40, 0x82, 0x90, 0x56, 0xa9, 0xf6, 0xbf, 0xd0,
0xff, 0xff, 0x47, 0x00, 0x50, 0x02, 0x15, 0x11, 0x40, 0x95, 0xaa, 0xfd,
0x2f, 0xe9, 0xff, 0xff, 0x8f, 0x0a, 0x84, 0x50, 0x40, 0x84, 0x14, 0xaa,
0x6a, 0xff, 0x5f, 0xf2, 0xff, 0xff, 0x7f, 0x00, 0x10, 0x02, 0x09, 0x10,
0x40, 0x7d, 0xf7, 0xff, 0x0b, 0xfc, 0xff, 0xff, 0xaf, 0x02, 0x84, 0x50,
0x42, 0x85, 0x12, 0xd0, 0xdd, 0xff, 0xa7, 0xf2, 0xff, 0xff, 0xff, 0x04,
0x00, 0x0a, 0x08, 0x10, 0x48, 0xf8, 0xff, 0xff, 0x0a, 0xfe, 0xff, 0xff,
0x7f, 0x03, 0xa4, 0x80, 0xa2, 0x8a, 0x02, 0x68, 0xff, 0xff, 0x52, 0xfd,
0xff, 0xff, 0xff, 0x07, 0x00, 0x2a, 0x08, 0x20, 0x28, 0xdc, 0xff, 0x5f,
0x05, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x92, 0x40, 0x22, 0x09, 0x02, 0xea,
0xfb, 0xaf, 0x48, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x12, 0x81, 0xa0,
0x48, 0x9c, 0x6e, 0x93, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x07, 0xa8, 0x40,
0x28, 0x0a, 0x02, 0x74, 0xb5, 0x45, 0x81, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x02, 0x0a, 0x81, 0x20, 0x08, 0xae, 0xaa, 0x90, 0xe8, 0xff, 0xff, 0xff,
0xff, 0x0f, 0x90, 0x40, 0x28, 0x88, 0x12, 0x58, 0x15, 0x50, 0xd0, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x44, 0x0a, 0x41, 0x21, 0x08, 0xae, 0x04, 0x14,
0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, 0x14, 0x88, 0x04, 0xba,
0x02, 0x28, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x42, 0x15, 0x41, 0x21,
0x05, 0xad, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40,
0x24, 0x8a, 0x0e, 0x36, 0x00, 0x0a, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x42, 0x25, 0x90, 0xd0, 0x8b, 0xc2, 0x41, 0x05, 0xfc, 0xff, 0xff, 0xff,
0xff, 0x0f, 0x10, 0x08, 0x05, 0xe8, 0x8e, 0x58, 0x80, 0x02, 0xfa, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x4a, 0x20, 0xa8, 0xba, 0x0b, 0x2b, 0x51, 0x01,
0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x8a, 0x02, 0xe8, 0xaf, 0x84,
0x90, 0x04, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x52, 0x21, 0x54, 0xbf,
0x1f, 0x15, 0xa5, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x08,
0x01, 0xfa, 0xb6, 0xa4, 0x52, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x4a, 0xa2, 0x54, 0xef, 0x5f, 0x4b, 0xa4, 0x80, 0xff, 0xff, 0xff, 0xff,
0xff, 0x0f, 0x80, 0x10, 0x82, 0xfe, 0xbf, 0x92, 0x52, 0x42, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x12, 0x42, 0xa8, 0xbf, 0x1f, 0x24, 0x80, 0xa0,
0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, 0x8a, 0xf7, 0x37, 0x80,
0x52, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x82, 0xe0, 0xff,
0x1f, 0x00, 0x20, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28,
0xca, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x10, 0x42, 0xf0, 0xfd, 0x1b, 0x00, 0x50, 0xf0, 0xff, 0xff, 0xff, 0xff,
0xff, 0x0f, 0xa4, 0x10, 0xc5, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x22, 0xf8, 0xff, 0x0e, 0x00, 0x00, 0xf0,
0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xaa, 0x88, 0xe2, 0xff, 0x0f, 0x10,
0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x25, 0xfa, 0xff,
0x0f, 0x01, 0x11, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xfb,
0xfb, 0xff, 0x7f, 0x5d, 0xd5, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f};

View file

@ -1,27 +0,0 @@
#define flagdown_width 48
#define flagdown_height 48
static char flagdown_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe1, 0x00, 0x00,
0x00, 0x00, 0x70, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00,
0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04,
0x00, 0x00, 0x03, 0x00, 0x06, 0x06, 0x00, 0x80, 0x01, 0x00, 0x06, 0x07,
0x00, 0xc0, 0x1f, 0x00, 0x87, 0x07, 0x00, 0xe0, 0x7f, 0x80, 0xc7, 0x07,
0x00, 0x70, 0xe0, 0xc0, 0xe5, 0x07, 0x00, 0x38, 0x80, 0xe1, 0x74, 0x07,
0x00, 0x18, 0x80, 0x71, 0x3c, 0x07, 0x00, 0x0c, 0x00, 0x3b, 0x1e, 0x03,
0x00, 0x0c, 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x86, 0x1f, 0x8e, 0x07, 0x00,
0x00, 0x06, 0x06, 0xc6, 0x05, 0x00, 0x00, 0x06, 0x00, 0xc6, 0x05, 0x00,
0x00, 0x06, 0x00, 0xc6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00,
0x7f, 0x06, 0x00, 0x06, 0xe4, 0xff, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00,
0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x06, 0x00,
0x00, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00,
0x00, 0x06, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00,
0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, 0x06, 0x00, 0x3e, 0x00, 0x00,
0x00, 0xfe, 0xff, 0x2f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x27, 0x00, 0x00,
0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
0xf7, 0xbf, 0x8e, 0xfc, 0xdf, 0xf8, 0x9d, 0xeb, 0x9b, 0x76, 0xd2, 0x7a,
0x46, 0x30, 0xe2, 0x0f, 0xe1, 0x47, 0x55, 0x84, 0x48, 0x11, 0x84, 0x19};

View file

@ -1,27 +0,0 @@
#define flagup_width 48
#define flagup_height 48
static char flagup_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00,
0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xef, 0x6a, 0x00,
0x00, 0x00, 0xc0, 0x7b, 0x75, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x6a, 0x00,
0x00, 0x00, 0x30, 0x60, 0x75, 0x00, 0x00, 0x00, 0x18, 0xe0, 0x7f, 0x00,
0x00, 0x00, 0x0c, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x04, 0x00,
0x00, 0x00, 0x03, 0xe0, 0x04, 0x00, 0x00, 0x80, 0x01, 0xe0, 0x06, 0x00,
0x00, 0xc0, 0x1f, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0xe0, 0x07, 0x00,
0x00, 0x70, 0xe0, 0xe0, 0x05, 0x00, 0x00, 0x38, 0x80, 0xe1, 0x04, 0x00,
0x00, 0x18, 0x80, 0xf1, 0x04, 0x00, 0x00, 0x0c, 0x00, 0xfb, 0x04, 0x00,
0x00, 0x0c, 0x00, 0xff, 0x04, 0x00, 0x00, 0x86, 0x1f, 0xee, 0x04, 0x00,
0x00, 0x06, 0x06, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00,
0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x66, 0x04, 0x00,
0x7f, 0x56, 0x52, 0x06, 0xe4, 0xff, 0x00, 0x76, 0x55, 0x06, 0x04, 0x00,
0x00, 0x56, 0x57, 0x06, 0x04, 0x00, 0x00, 0x56, 0x55, 0x06, 0x06, 0x00,
0x00, 0x56, 0xd5, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00,
0x54, 0x06, 0x00, 0xc6, 0x54, 0x55, 0xaa, 0x06, 0x00, 0x66, 0xaa, 0x2a,
0x54, 0x06, 0x00, 0x36, 0x55, 0x55, 0xaa, 0x06, 0x00, 0xbe, 0xaa, 0x2a,
0x54, 0xfe, 0xff, 0x6f, 0x55, 0x55, 0xaa, 0xfc, 0xff, 0xa7, 0xaa, 0x2a,
0x54, 0x01, 0x88, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
0x54, 0x55, 0x8d, 0x50, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa8, 0xaa, 0x2a,
0x54, 0x55, 0x95, 0x54, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a,
0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View file

@ -1,6 +0,0 @@
#define grey_width 16
#define grey_height 16
static char grey_bits[] = {
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44};

View file

@ -1,6 +0,0 @@
#define grey_width 16
#define grey_height 16
static char grey_bits[] = {
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44};

View file

@ -1,6 +0,0 @@
#define grey_width 16
#define grey_height 16
static char grey_bits[] = {
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa};

View file

@ -1,27 +0,0 @@
#define letters_width 48
#define letters_height 48
static char letters_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20,
0x00, 0xfa, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2e,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x21,
0xa0, 0x03, 0x00, 0x00, 0x70, 0x21, 0x20, 0x00, 0x00, 0x00, 0x50, 0x21,
0xa0, 0x1f, 0x00, 0x00, 0x50, 0x21, 0x20, 0x00, 0x00, 0x00, 0x70, 0x21,
0xfe, 0xff, 0xff, 0xff, 0x0f, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21,
0xfa, 0x01, 0x00, 0x80, 0x0b, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0a, 0x21,
0xba, 0x01, 0x00, 0x80, 0x0a, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0b, 0x21,
0x3a, 0x00, 0x00, 0x00, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21,
0x02, 0xc0, 0xfb, 0x03, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x3f,
0x02, 0xc0, 0xbd, 0x0f, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
0x02, 0xc0, 0x7f, 0x7b, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
0x02, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View file

@ -1,27 +0,0 @@
#define noletters_width 48
#define noletters_height 48
static char noletters_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00,
0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01,
0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x07,
0xe0, 0x01, 0x00, 0x00, 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x0e,
0xf0, 0x00, 0x00, 0x00, 0x3c, 0x1e, 0x70, 0x00, 0x00, 0x00, 0x1e, 0x1c,
0x38, 0x00, 0x00, 0x00, 0x0f, 0x38, 0x38, 0x00, 0x00, 0x80, 0x07, 0x38,
0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x1c, 0x04, 0x00, 0xe0, 0x41, 0x70,
0x1c, 0x04, 0x00, 0xf0, 0x40, 0x70, 0x1c, 0x74, 0x00, 0x78, 0x4e, 0x70,
0x0e, 0x04, 0x00, 0x3c, 0x4a, 0xe0, 0x0e, 0x74, 0x03, 0x1e, 0x4a, 0xe0,
0x0e, 0x04, 0x00, 0x0f, 0x4e, 0xe0, 0x0e, 0x04, 0x80, 0x07, 0x40, 0xe0,
0x0e, 0x04, 0xf8, 0x0f, 0x40, 0xe0, 0x0e, 0x04, 0xe0, 0x01, 0x40, 0xe0,
0x0e, 0x04, 0xf8, 0x00, 0x40, 0xe0, 0x0e, 0x04, 0x78, 0x00, 0x40, 0xe0,
0x0e, 0x04, 0xfc, 0xf3, 0x40, 0xe0, 0x1c, 0x04, 0x1e, 0x00, 0x40, 0x70,
0x1c, 0x04, 0x0f, 0x00, 0x40, 0x70, 0x1c, 0x84, 0x07, 0x00, 0x40, 0x70,
0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x38, 0xe0, 0x01, 0x00, 0x00, 0x38,
0x38, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x70, 0x78, 0x00, 0x00, 0x00, 0x1c,
0xf0, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0xe0, 0x1e, 0x00, 0x00, 0x00, 0x0e,
0xe0, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x07,
0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01,
0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00,
0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,
0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00};

View file

@ -1,6 +0,0 @@
#define foo_width 16
#define foo_height 16
static char foo_bits[] = {
0x60, 0x06, 0x90, 0x09, 0x90, 0x09, 0xb0, 0x0d, 0x4e, 0x72, 0x49, 0x92,
0x71, 0x8e, 0x8e, 0x71, 0x8e, 0x71, 0x71, 0x8e, 0x49, 0x92, 0x4e, 0x72,
0xb0, 0x0d, 0x90, 0x09, 0x90, 0x09, 0x60, 0x06};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

File diff suppressed because one or more lines are too long

View file

@ -123,7 +123,7 @@ TkcLine.new(cvs, '5c','6c','9c','6c','9c','1c','8c','1c','8c','4.8c','8.8c',
'8.6c','1.4c','8.4c','1.4c','8.4c','4.4c',
'width'=>3, 'fill'=>red, 'tags'=>$tag_item )
TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c',
'stipple'=>'@'+[$demo_dir,
'stipple'=>'@'+[$demo_dir,'..',
'images','gray25.xbm'].join(File::Separator),
'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item )
TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c',
@ -139,7 +139,7 @@ TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c',
TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c',
'16.5c','4.5c','13.5c','7.5c','12c','6c',
'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round',
'stipple'=>'@'+[$demo_dir,
'stipple'=>'@'+[$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator),
'fill'=>red, 'tags'=>$tag_item )
@ -154,7 +154,7 @@ TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c',
TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c',
'28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c',
'7.5c','22c','7.5c',
'stipple'=>'@' + [$demo_dir,
'stipple'=>'@' + [$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator),
'outline'=>'black', 'tags'=>$tag_item )
@ -164,7 +164,7 @@ TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c',
TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c',
'fill'=>green, 'tags'=>$tag_item )
TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'',
'stipple'=>'@'+[$demo_dir,
'stipple'=>'@'+[$demo_dir,'..',
'images','gray25.xbm'].join(File::Separator),
'fill'=>blue, 'tags'=>$tag_item )
@ -174,7 +174,7 @@ TkcOval.new(cvs, '11c','9.5c','14c','12.5c',
TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c',
'fill'=>green, 'tags'=>$tag_item )
TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'',
'stipple'=>'@'+[$demo_dir,
'stipple'=>'@'+[$demo_dir,'..',
'images','gray25.xbm'].join(File::Separator),
'fill'=>blue, 'tags'=>$tag_item )
@ -188,7 +188,7 @@ TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue,
TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c')
if $tk_version =~ /^4\.[01]/
TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red,
'stipple'=>'@' + [$demo_dir,
'stipple'=>'@' + [$demo_dir, '..',
'images', 'grey.5'].join(File::Separator),
'text'=>'Stippled characters', 'tags'=>$tag_item )
else
@ -206,7 +206,7 @@ TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black',
# 'tags'=>$tag_item)
TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc',
'outline'=>blue, 'start'=>135, 'extent'=>270,
'outlinestipple'=>'@'+[$demo_dir,
'outlinestipple'=>'@'+[$demo_dir, '..',
'images','gray25.xbm'].join(File::Separator),
'tags'=>$tag_item)
TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice',
@ -221,14 +221,14 @@ TkcText.new(cvs, '15c', '16.2c', 'text'=>'Bitmaps', 'anchor'=>'n')
# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator),
# 'tags'=>$tag_item)
TkcBitmap.new(cvs, '13c','20c',
'bitmap'=>'@' + [$demo_dir,
'bitmap'=>'@' + [$demo_dir, '..',
'images', 'face.xbm'].join(File::Separator),
'tags'=>$tag_item)
#TkcBitmap.new(cvs, '17c','18.5c',
# 'bitmap'=>'@' + ['images', 'noletters'].join(File::Separator),
# 'tags'=>$tag_item)
TkcBitmap.new(cvs, '17c','18.5c',
'bitmap'=>'@' + [$demo_dir,
'bitmap'=>'@' + [$demo_dir, '..',
'images', 'noletter.xbm'].join(File::Separator),
'tags'=>$tag_item)
#TkcBitmap.new(cvs, '17c','21.5c',
@ -236,7 +236,7 @@ TkcBitmap.new(cvs, '17c','18.5c',
# 'tags'=>$tag_item)
#
TkcBitmap.new(cvs, '17c','21.5c') {
bitmap '@' + [$demo_dir, 'images', 'letters.xbm'].join(File::Separator)
bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator)
tags $tag_item
}
#TkcBitmap.new(cvs, '17c','21.5c') {

View file

@ -60,7 +60,7 @@ f_right = TkFrame.new($label_demo)
].each{|w| w.pack('side'=>'top', 'expand'=>'yes', 'pady'=>2, 'anchor'=>'w')}
TkLabel.new(f_right) {
bitmap('@' + [$demo_dir,'images','face.xbm'].join(File::Separator))
bitmap('@' + [$demo_dir,'..','images','face.xbm'].join(File::Separator))
borderwidth 2
relief 'sunken'
}.pack('side'=>'top')

View file

@ -15,7 +15,7 @@ $menu_demo = TkToplevel.new {|w|
positionWindow(w)
}
# menu frame <20><><EFBFBD><EFBFBD>
# menu frame
$menu_frame = TkFrame.new($menu_demo, 'relief'=>'raised', 'bd'=>2)
$menu_frame.pack('side'=>'top', 'fill'=>'x')
@ -149,7 +149,8 @@ TkMenubutton.new($menu_frame, 'text'=>'Icons', 'underline'=>0) {|m|
TkMenu.new(m, 'tearoff'=>false) {|icon_menu|
m.configure('menu'=>icon_menu)
add('command',
'bitmap'=>'@'+[$demo_dir,'images','pattern.xbm'].join(File::Separator),
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.',
'bitmap'=>'', 'default'=>0,

View file

@ -157,7 +157,8 @@ TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
TkMenu.new($menu84_frame, 'tearoff'=>false) {|m|
$menu84_frame.add('cascade', 'label'=>'Icons', 'menu'=>m, 'underline'=>0)
add('command', 'hidemargin'=>1,
'bitmap'=>'@'+[$demo_dir,'images','pattern.xbm'].join(File::Separator),
'bitmap'=>'@'+[$demo_dir,'..',
'images','pattern.xbm'].join(File::Separator),
'command'=>proc{TkDialog.new('title'=>'Bitmap Menu Entry',
'text'=>'The menu entry you invoked displays a bitmap rather than a text string. Other than this, it is just like any other menu entry.',
'bitmap'=>'', 'default'=>0,

View file

@ -58,7 +58,7 @@ TkFrame.new($menubu_demo) {|frame|
TkButton.new(frame) {
text 'Show Code'
command proc{showCode 'menu'}
command proc{showCode 'menubu'}
}.pack('side'=>'left', 'expand'=>'yes')
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')

View file

@ -1,4 +1,4 @@
# radio.rb
# radio2.rb
#
# This demonstration script creates a toplevel window containing
# several radiobutton widgets.
@ -14,8 +14,8 @@ end
# demo toplevel widget
$radio2_demo = TkToplevel.new {|w|
title("Radiobutton Demonstration")
iconname("radio")
title("Radiobutton Demonstration 2")
iconname("radio2")
positionWindow(w)
}
@ -47,7 +47,7 @@ TkFrame.new($radio2_demo) {|frame|
TkButton.new(frame) {
text 'Show Code'
command proc{showCode 'radio'}
command proc{showCode 'radio2'}
}.pack('side'=>'left', 'expand'=>'yes')
TkButton.new(frame) {

View file

@ -76,11 +76,13 @@ $demo_rulerInfo.normalStyle = {'fill'=>'black'}
if TkWinfo.depth($ruler_canvas) > 1
$demo_rulerInfo.activeStyle = {'fill'=>'red', 'stipple'=>''}
$demo_rulerInfo.deleteStyle = {'fill'=>'red',
'stipple'=>'@'+[$demo_dir, 'images', 'gray25.xbm'].join(File::Separator)}
'stipple'=>'@'+[$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator)}
else
$demo_rulerInfo.activeStyle = {'fill'=>'black', 'stipple'=>''}
$demo_rulerInfo.deleteStyle = {'fill'=>'black',
'stipple'=>'@'+[$demo_dir, 'images', 'gray25.xbm'].join(File::Separator)}
'stipple'=>'@'+[$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator)}
end
TkcLine.new($ruler_canvas,

View file

@ -133,7 +133,7 @@ TkFrame.new($search_demo) {|f|
}
}.pack('side'=>'top', 'fill'=>'x')
$search_text = TkText.new($search_demo, 'setgrid'=>true) {|t|
$search_text = TkText.new($search_demo, 'setgrid'=>true, 'wrap'=>'word') {|t|
$search_Tag = TkTextTag.new(t)
TkScrollbar.new($search_demo, 'command'=>proc{|*args| t.yview(*args)}) {|sc|
t.yscrollcommand(proc{|first,last| sc.set first,last})
@ -146,45 +146,33 @@ $search_text = TkText.new($search_demo, 'setgrid'=>true) {|t|
if TkWinfo.depth($search_demo) > 1
textToggle(proc{
begin
$search_Tag.configure('background'=>'#ce5555',
'foreground'=>'white')
rescue
end
$search_Tag.configure('background'=>'#ce5555',
'foreground'=>'white')
},
800,
proc{
begin
$search_Tag.configure('background'=>'', 'foreground'=>'')
rescue
end
$search_Tag.configure('background'=>'', 'foreground'=>'')
},
200 )
else
textToggle(proc{
begin
$search_Tag.configure('background'=>'black',
'foreground'=>'white')
rescue
end
$search_Tag.configure('background'=>'black',
'foreground'=>'white')
},
800,
proc{
begin
$search_Tag.configure('background'=>'', 'foreground'=>'')
rescue
end
$search_Tag.configure('background'=>'', 'foreground'=>'')
},
200 )
end
$search_text.insert('1.0', '\
This window demonstrates how to use the tagging facilities in text
widgets to implement a searching mechanism. First, type a file name
in the top entry, then type <Return> or click on "Load File". Then
type a string in the lower entry and type <Return> or click on
"Load File". This will cause all of the instances of the string to
be tagged with the tag "search", and it will arrange for the tag\'s
display attributes to change to make all of the strings blink.')
$search_text.insert('1.0', "\
This window demonstrates how to use the tagging facilities in text \
widgets to implement a searching mechanism. First, type a file name \
in the top entry, then type <Return> or click on \"Load File\". Then \
type a string in the lower entry and type <Return> or click on \
\"Load File\". This will cause all of the instances of the string to \
be tagged with the tag \"search\", and it will arrange for the tag\'s \
display attributes to change to make all of the strings blink.")
$search_text.set_insert '0.0'
$search_fileName.value = ''

View file

@ -94,7 +94,7 @@ TkText.new($style_demo){|t|
'relief'=>'sunken', 'borderwidth'=>1)
end
# テキストタグ設定 (その他)
#
if $tk_version =~ /^4\.[01]/
style_tag_bgstipple = TkTextTag.new(t, 'background'=>'black',
'borderwidth'=>0,

View file

@ -1,30 +1,28 @@
#!/usr/bin/env ruby
#
# tcolor --
# このスクリプトはRGB,HSB,CYM形式をサポートする
# 簡易カラーエディタです。
# simple color editor which supports RGB, HSB and CYM color space
#
# Copyright (C) 1998 Takaaki Tateishi(ttate@jaist.ac.jp)
# last update: Thu Jun 18 06:32:35 JST 1998
#
# まずはtk.rbを読み込む。
require "tk"
# Tkによって変更される変数はTkVariableのインスタンスを使う。
# use TkVariable instance for the variable which is changed by Tk interpreter
$colorSpace = TkVariable.new(:rgb)
$master = nil
$red = 65535
$green = 0
$blue = 0
$color = "#ffff00000000"
$updating = TkVariable.new(0)
$autoUpdate = TkVariable.new(1)
$name = TkVariable.new("")
# $command = TkVariable.new("print(%%,\"\n\")")
$command = TkVariable.new("")
$name = TkVariable.new($color)
$command = TkVariable.new("print(%%,\"\n\")")
# $command = TkVariable.new("")
$label1 = TkVariable.new("label1")
$label2 = TkVariable.new("label2")
$label3 = TkVariable.new("label3")
@ -36,7 +34,7 @@ if (TkVarAccess.new('tcl_platform')['platform'] == 'unix')
end
# 各イベント用のメソッド
# methods for events
def rgbToHsv(red,green,blue)
@ -134,6 +132,8 @@ def tc_scaleChanged
return
end
$master = :scale if $master == nil
scale1 = $root.middle.middle.scale1
scale2 = $root.middle.middle.scale2
scale3 = $root.middle.middle.scale3
@ -158,11 +158,13 @@ def tc_scaleChanged
raise(Exception,"unknown colorSpace")
end
$color = format("#%04x%04x%04x",$red.to_i,$green.to_i,$blue.to_i)
$name.value = $color if $master == :scale
$root.middle.right.set_color($color)
if( $autoUpdate.to_i == 1 )
doUpdate
end
Tk.update(TRUE)
Tk.update(true)
$master = nil if $master == :scale
end
@ -196,6 +198,8 @@ end
def tc_loadNamedColor(name)
$name.value = name
$master = :name if $master == nil
if name[0,1] != "#"
list = TkWinfo.rgb($root.middle.right.swatch,name)
$red = list[0]
@ -222,9 +226,9 @@ def tc_loadNamedColor(name)
if strlist.length != 3
raise(eException,"syntax error in color name \"#{name}\"")
end
$red = strlist[0].to_i
$green = strlist[1].to_i
$blue = strlist[2].to_i
$red = strlist[0].hex
$green = strlist[1].hex
$blue = strlist[2].hex
}
$red = $red << shift
$green = $green << shift
@ -237,6 +241,8 @@ def tc_loadNamedColor(name)
if $autoUpdate.to_i == 1
doUpdate
end
Tk.update(true)
$master = nil if $master == :name
end
@ -259,10 +265,7 @@ def changeColorSpace(space)
end
# tcolor用のメニュー
# menu
class TkColorMenuFrame<TkFrame
def initialize(parent)
@ -270,10 +273,10 @@ class TkColorMenuFrame<TkFrame
"relief"=>"raised",
"borderwidth"=>"2")
# Fileメニューボタンの生成
# File menubutton
@file = TkMenubutton.new(self){|button|
# Fileメニューの作成
# File menu
@file_menu = TkMenu.new(button){
add "radio",
"label" => "RGB color space",
@ -311,7 +314,7 @@ class TkColorMenuFrame<TkFrame
"command" => proc{exit}
}
# FileメニューとFileボタンを関連付ける
# assign File menu to File button
menu @file_menu
text "File"
@ -323,7 +326,7 @@ class TkColorMenuFrame<TkFrame
end
# 下部のフレームのためのクラス
# bottom frame
class TkColorBotFrame<TkFrame
def initialize(parent)
super(parent,
@ -349,7 +352,7 @@ class TkColorBotFrame<TkFrame
end
# 中段左のフレーム
# left side frame of middle level
class TkColorMiddleLeftFrame<TkFrame
def initialize(parent)
super(parent)
@ -393,9 +396,8 @@ class TkColorMiddleLeftFrame<TkFrame
end
# 中段中央のフレーム
# middle frame of middle level
class TkColorMiddleMiddleFrame<TkFrame
# @scale1,@scale2,@scale3を外部から参照のみ許可する。(変更不可)
attr_reader :scale1, :scale2, :scale3
def initialize(parent)
@ -470,7 +472,7 @@ end
# 中段のフレーム
# middle level frame
class TkColorMiddleFrame<TkFrame
attr_reader :left, :middle, :right
@ -513,7 +515,7 @@ end
$root = TkColor.new
# イベントを待つ為にループに入る。
changeColorSpace :rgb
# start eventloop
Tk.mainloop

View file

@ -10,12 +10,7 @@
# as needed.
require 'tk'
#unless /^8\.[1-9]/ =~ Tk::TCL_VERSION && !Tk::JAPANIZED_TK
# require 'tkencoding'
#end
require 'tkafter'
# require 'tkafter'
### $DEBUG=1 ##########
@ -33,12 +28,78 @@ $root = TkRoot.new{title "Ruby/Tk Widget Demonstration"}
# tk
$tk_version = Tk::TK_VERSION
$tk_major_ver, $tk_minor_ver = $tk_version.split('.').map{|n| n.to_i}
$tk_patchlevel = Tk::TK_PATCHLEVEL
# tcl_platform
$tk_platform = TkVarAccess.new('tcl_platform')
#
$font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil)
case($tk_version)
when /^4.*/
$font = TkFont.new('-*-Helvetica-Medium-R-Normal--*-140-*-*-*-*-*-*', nil)
else
$font = TkFont.new('Helvetica -12')
end
# images
$image = {}
if $tk_major_ver >= 8
$image['refresh'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
R0lGODlhEAAQAPMAAMz/zCpnKdb/1z9mPypbKBtLGy9NMPL/9Or+6+P+4j1Y
PwQKBP7//xMLFAYBCAEBASH5BAEAAAAALAAAAAAQABAAAwR0EAD3Gn0Vyw0e
++CncU7IIAezMA/nhUqSLJizvSdCEEjy2ZIV46AwDAoDHwPYGSoEiUJAAGJ6
EDHBNCFINW5OqABKSFk/B9lUa94IDwIFgewFMwQDQwCZQCztTgM9Sl8SOEMG
KSAthiaOjBMPDhQONBiXABEAOw==
EOD
end
if $tk_major_ver >= 8
$image['view'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
R0lGODlhEAAQAPMAAMz/zP///8DAwICAgH9/fwAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAAQABAAAwRIcMhJB7h3hM33
KFjWdQQYap1QrCaGBmrRrS4nj5b53jOgbwXBKGACoYLDIuAoHCmZyYvR1rT5
RMAq8LqcIYGsrjPsW1XOmFUEADs=
EOD
end
if $tk_major_ver >= 8
$image['delete'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
R0lGODlhEAAOAKEAAIQAAO/n3v///////yH5BAEKAAIALAAAAAAQAA4AAAIm
lI9pAKHbIHNoVhYhTdjlJ2AWKG2g+CldmB6rxo2uybYhbS80eRQAOw==
EOD
end
if $tk_major_ver >= 8
$image['print'] = TkPhotoImage.new(:height=>16, :format=>'GIF', :data=><<EOD)
R0lGODlhGgATAPcAACEQOTEpQjEpUkIpc0IxY0I5c0oxjEo5SlJCY1JCe1JK
UlpChFpCjFpGkFpSc1paa2NKc2NKnGNja2tapWtjc29KnHNanHNjc3NjrXNr
jHNrnHNzc3tjpXtrtXtzhICAgIRzvYSEjIZzqox7tYyEnIyMjJSEtZSEvZSM
lJyMtZyMvZyUlJyUrZyUvZycnKWctaWlpa2czq2lzrWtvbWtzrW1tb21xr21
1sa9zs693s7OztbO3tbO597W1t7W7+fe7+fn5////+/n7+/v7+/v9////wAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAACH5BAEAAEEALAAAAAAaABMAQAj/AIMIHBhkg0GC
CBMGIQEiQgseQT4oeCBBAokgRYYQ0JBixg8hRIiUUEBBYYmTByBwiCBCRYwH
CxY8cKFw4AogRXLqLAJkQ80gCBBg3BkxZswTNGh4MGqgQQUMJRHCwMkTSE+D
Pn8eCKBhxIMhO3ei2OHDBw6sWSlMMMoWgwwfMDZI8GBjx44NARZwEGGi5MkS
PcIWKRGz5YgLbAco+KkQBQoJIRgjdGEVq+SaJajqtNrzMgsPCmoIzqmDgmWE
KOBuUKAAwYabYTfs4OHjY0giGyhk4MAWRI4eKyRQqPgggYUXPH4A+XBAgwoK
DiIsCFxjA9sFEVQQCRJCAYAFDJxiKhAxvMTonEFimrhhYinTBgWiCvxLNX3M
DkkpsKV5OYhjBxCMYAICAigUEAA7
EOD
end
#
TkMenubar.new($root,
@ -48,6 +109,7 @@ TkMenubar.new($root,
['Quit', proc{exit}, 0, 'Meta-Q']
]]).pack('side'=>'top', 'fill'=>'x')
$root.bind('F1', proc{aboutBox})
$root.bind('Meta-q', proc{exit})
=begin
TkFrame.new($root){|frame|
@ -67,7 +129,7 @@ if $tk_version =~ /^4\.[01]/
scr = TkScrollbar.new($root, 'orient'=>'vertical')
txt = TkText.new($root) {
wrap 'word'
width 60
width 70
height 30
font $font
setgrid 'yes'
@ -84,7 +146,7 @@ else
}
txt = TkText.new($root) {
wrap 'word'
width 60
width 70
height 30
font $font
setgrid 'yes'
@ -92,6 +154,7 @@ else
padx 4
pady 2
takefocus 0
bd 1
yscrollcommand proc{|first,last| scr.set first,last}
}
scr.command(proc{|*args| txt.yview(*args)})
@ -123,7 +186,7 @@ tag_title = TkTextTag.new(txt, 'font'=>'-*-Helvetica-Bold-R-Normal--*-180-*-*-*-
tag_demospace = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c')
if TkWinfo.depth($root) == '1'
if TkWinfo.depth($root) == 1
tag_demo = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
'underline'=>1)
$tag_visited = TkTextTag.new(txt, 'lmargin1'=>'1c', 'lmargin2'=>'1c',
@ -206,21 +269,25 @@ txt.insert('end', "3. Buttons.\n", tag_demo, "demo-button")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "4. Checkbuttons (select any of a group).\n", tag_demo, "demo-check")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "5. Radiobuttons (select one of a group).\n", tag_demo, "demo-radio")
txt.insert('end', "5. Checkbuttons (if supported).\n", tag_demo, "demo-check2")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "6. Radiobuttons (if supported 'compound' option).\n", tag_demo, "demo-radio2")
txt.insert('end', "6. Radiobuttons (select one of a group).\n", tag_demo, "demo-radio")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "7. A 15-puzzle game made out of buttons.\n", tag_demo, "demo-puzzle")
txt.insert('end', "7. Radiobuttons (if supported 'compound' option).\n", tag_demo, "demo-radio2")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "8. Iconic buttons that use bitmaps.\n", tag_demo, "demo-icon")
txt.insert('end', "8. Radiobuttons (if supported).\n", tag_demo, "demo-radio3")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "9. Two labels displaying images.\n", tag_demo, "demo-image1")
txt.insert('end', "9. A 15-puzzle game made out of buttons.\n", tag_demo, "demo-puzzle")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "10. A simple user interface for viewing images.\n", tag_demo, "demo-image2")
txt.insert('end', "10. Iconic buttons that use bitmaps.\n", tag_demo, "demo-icon")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "11. A simple user interface for viewing images. (if supported)\n", tag_demo, "demo-image3")
txt.insert('end', "11. Two labels displaying images.\n", tag_demo, "demo-image1")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "12. Labelled frames (if supported)\n", tag_demo, "demo-labelframe")
txt.insert('end', "12. A simple user interface for viewing images.\n", tag_demo, "demo-image2")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "13. A simple user interface for viewing images. (if supported)\n", tag_demo, "demo-image3")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "14. Labelled frames (if supported)\n", tag_demo, "demo-labelframe")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
@ -260,7 +327,9 @@ txt.insert('end', "3. Hypertext (tag bindings).\n", tag_demo, "demo-bind")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "4. A text widget with embedded windows.\n", tag_demo, "demo-twind")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "5. A search tool built with a text widget.\n", tag_demo, "demo-search")
txt.insert('end', "5. A text widget with embedded windows. (if supported)\n", tag_demo, "demo-twind2")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "6. A search tool built with a text widget.\n", tag_demo, "demo-search")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
@ -278,7 +347,9 @@ txt.insert('end', "5. A ruler with adjustable tab stops.\n", tag_demo, "demo-rul
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "6. A building floor plan.\n", tag_demo, "demo-floor")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "7. A simple scrollable canvas.\n", tag_demo, "demo-cscroll")
txt.insert('end', "7. A building floor plan. (another way to create canvas items)\n", tag_demo, "demo-floor2")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "8. A simple scrollable canvas.\n", tag_demo, "demo-cscroll")
txt.insert('end', " \n ", tag_demospace)
txt.insert('end', "\n")
@ -350,7 +421,7 @@ end
# args - Any number of names of variables.
$showVarsWin = {}
def showVars (parent, *args)
def showVars1(parent, *args)
if $showVarsWin[parent.path]
begin
$showVarsWin[parent.path].destroy
@ -385,11 +456,54 @@ def showVars (parent, *args)
$showVarsWin[parent.path] = w
end
def showVars2(parent, *args)
if $showVarsWin[parent.path]
begin
$showVarsWin[parent.path].destroy
rescue
end
end
$showVarsWin[parent.path] = TkToplevel.new(parent) {|w|
title "Variable values"
TkLabelFrame.new(w, :text=>"Variable values:",
:font=>{:family=>'Helvetica', :size=>14}){|f|
args.each{|vnam,vbody|
TkGrid(TkLabel.new(f, :text=>"#{vnam}: ", :anchor=>'w'),
TkLabel.new(f, :textvariable=>vbody, :anchor=>'w'),
:padx=>2, :pady=>2, :sticky=>'w')
}
f.grid(:sticky=>'news', :padx=>4)
f.grid_columnconfig(1, :weight=>1)
f.grid_rowconfig(100, :weight=>1)
}
TkButton.new(w, :text=>"OK", :width=>8, :default=>:active,
:command=>proc{w.destroy}){|b|
w.bind('Return', proc{b.invoke})
w.bind('Escape', proc{b.invoke})
b.grid(:sticky=>'e', :padx=>4, :pady=>[6, 4])
}
w.grid_columnconfig(0, :weight=>1)
w.grid_rowconfig(0, :weight=>1)
}
end
if $tk_major_ver < 8
alias showVars showVars1
elsif $tk_major_ver == 8 && $tk_minor_ver < 5
alias showVars showVars1
else # ver >= 8.5
alias showVars showVars2
end
# invoke --
# This procedure is called when the user clicks on a demo description.
# It is responsible for invoking the demonstration.
#
# Arguments:
# txt - Name of text widget
# index - The index of the character that the user clicked on.
def invoke (txt, index)
@ -399,7 +513,8 @@ def invoke (txt, index)
txt.cursor('watch')
Tk.update
# eval `cat #{tag[5..-1]}.rb`
eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`
# eval `cat #{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb`
eval IO.readlines("#{[$demo_dir, tag[5..-1]].join(File::Separator)}.rb").join
Tk.update
# txt.cursor('xterm')
txt.cursor(cursor)
@ -433,13 +548,13 @@ end
# a demonstration and allows it to be edited and reinvoked.
#
# Arguments:
# w - The name of the demonstration's window, which can be
# demo - The name of the demonstration's window, which can be
# used to derive the name of the file containing its code.
def showCode (demo)
def showCode1(demo)
file = "#{demo}.rb"
$code_window = nil unless defined? $code_window
if $code_window == nil || TkWinfo.exist?($code_window) == '0'
if $code_window == nil || TkWinfo.exist?($code_window) == false
$code_window = TkToplevel.new(nil)
f = TkFrame.new($code_window)
TkButton.new(f) {
@ -516,16 +631,192 @@ def showCode (demo)
fid.close
end
def showCode2(demo)
file = "#{demo}.rb"
$code_window = nil unless defined? $code_window
if $code_window == nil || TkWinfo.exist?($code_window) == false
$code_window = TkToplevel.new(nil)
tf = TkFrame.new($code_window)
$code_text = TkText.new(tf, :font=>'Courier 10', :height=>30,
:wrap=>'word', :bd=>1, :setgrid=>true,
:highlightthickness=>0, :pady=>2, :padx=>3)
xscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)}
yscr = TkScrollbar.new(tf, :bd=>1){assign($code_text)}
TkGrid($code_text, yscr, :sticky=>'news')
#TkGrid(xscr)
tf.grid_rowconfigure(0, :weight=>1)
tf.grid_columnconfigure(0, :weight=>1)
bf = TkFrame.new($code_window)
b_dis = TkButton.new(bf, :text=>'Dismiss', :default=>:active,
:command=>proc{
$code_window.destroy
$code_window = nil
},
:image=>$image['delete'], :compound=>:left)
b_prn = TkButton.new(bf, :text=>'Print Code',
:command=>proc{printCode($code_text, file)},
:image=>$image['print'], :compound=>:left)
b_run = TkButton.new(bf, :text=>'Rerun Demo',
:command=>proc{eval($code_text.get('1.0','end'))},
:image=>$image['refresh'], :compound=>:left)
TkGrid('x', b_run, b_prn, b_dis, :padx=>4, :pady=>[6,4])
bf.grid_columnconfigure(0, :weight=>1)
TkGrid(tf, :sticky=>'news')
TkGrid(bf, :sticky=>'ew')
$code_window.grid_columnconfigure(0, :weight=>1)
$code_window.grid_rowconfigure(0, :weight=>1)
$code_window.bind('Return', proc{|win|
b_dis.invoke unless win.kind_of?(TkText)
}, '%W')
$code_window.bindinfo('Return').each{|cmd, arg|
$code_window.bind_append('Escape', cmd, arg)
}
else
$code_window.deiconify
$code_window.raise
end
$code_window.title("Demo code: #{file}")
$code_window.iconname(file)
fid = open([$demo_dir, file].join(File::Separator), 'r')
$code_text.delete('1.0', 'end')
$code_text.insert('1.0', fid.read)
TkTextMarkInsert.new($code_text,'1.0')
fid.close
end
if $tk_major_ver < 8
alias showCode showCode1
elsif $tk_major_ver == 8 && $tk_minor_ver < 5
alias showCode showCode1
else # ver >= 8.5
alias showCode showCode2
end
# printCode --
# Prints the source code currently displayed in the See Code dialog.
# Much thanks to Arjen Markus for this.
#
# Arguments:
# txt - Name of text widget containing code to print
# file - Name of the original file (implicitly for title)
def printCode(txt, file)
code = txt.get('1.0', 'end - 1c')
dir = '.'
dir = ENV['HOME'] if ENV['HOME']
dir = ENV['TMP'] if ENV['TMP']
dir = ENV['TEMP'] if ENV['TEMP']
fname = [dir, 'tkdemo-' + file].join(File::Separator)
open(fname, 'w'){|fid| fid.print(code)}
begin
case Tk::TCL_PLATFORM('platform')
when 'unix'
msg = `lp -c #{fname}`
unless $?.exitstatus == 0
Tk.messageBox(:title=>'Print spooling failure',
:message=>'Print spooling probably failed: ' + msg)
end
when 'windows'
begin
printTextWin32(fname)
rescue => e
Tk.messageBox(:title=>'Print spooling failure',
:message=>'Print spooling probably failed: ' +
e.message)
end
when 'macintosh'
Tk.messageBox(:title=>'Operation not Implemented',
:message=>'Oops, sorry: not implemented yet!')
else
Tk.messageBox(:title=>'Operation not Implemented',
:message=>'Wow! Unknown platform: ' +
Tk::TCL_PLATFORM('platform'))
end
ensure
File.delete(fname)
end
end
# printTextWin32 --
# Print a file under Windows
#
# Arguments:
# filename - Name of the file
#
def printTextWin32(fname)
require 'win32/registry'
begin
app = Win32::Registry::HKEY_CLASSES_ROOT['.txt']
pcmd = nil
Win32::Registry::HKEY_CLASSES_ROOT.open("#{app}\\shell\\print"){|reg|
pcmd = reg['command']
}
rescue
app = Tk.tk_call('auto_execok', 'notepad.exe')
pcmd = "#{app} /p %1"
end
pcmd.gsub!('%1', fname)
puts pcmd
cmd = Tk.tk_call('auto_execok', 'start') + ' /min ' + pcmd
msg = `#{cmd}`
unless $?.exitstatus == 0
fail RuntimeError, msg
end
end
# aboutBox
#
# Pops up a message box with an "about" message
#
def aboutBox
Tk.messageBox('icon'=>'info', 'type'=>'ok', 'title'=>'About Widget Demo',
'message'=>"Ruby/Tk widget demonstration Ver.1.3.2-en\n\n( based on Tk 8.1 Copyright (c) 1996-1997 Sun Microsystems, Inc. )\n\nRunning Version :: Ruby#{VERSION}/Tk#{$tk_version}")
'message'=>"Ruby/Tk widget demonstration Ver.1.4.3-en\n\n" +
"based on demos of Tk8.1 -- 8.5 " +
"( Copyright:: " +
"(c) 1996-1997 Sun Microsystems, Inc. / " +
"(c) 1997-2000 Ajuba Solutions, Inc. / " +
"(c) 2001-2003 Donal K. Fellows )\n\n" +
"Your Ruby & Tk Version ::\n" +
"Ruby#{RUBY_VERSION}(#{RUBY_RELEASE_DATE})[#{RUBY_PLATFORM}] / Tk#{$tk_patchlevel}#{(Tk::JAPANIZED_TK)? '-jp': ''}")
end
################################
#########################################
# start demos if given at command line
no_launcher = false
if ARGV[0] == '-n'
ARGV.shift
no_launcher = true if ARGV.size > 0
end
ARGV.each{|cmd|
if cmd =~ /(.*).rb/
cmd = $1
end
eval IO.readlines("#{[$demo_dir, cmd].join(File::Separator)}.rb").join
}
if no_launcher
$root.withdraw # hide root window
Thread.start{
loop do
count = 0
$root.winfo_children.each{|w|
count += 1 if w.kind_of?(TkToplevel)
}
$root.destroy if count == 0
end
}
end
#########################################
# start eventloop
Tk.mainloop

View file

@ -104,7 +104,8 @@ TkLabel.new($arrow_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
# frame <20><><EFBFBD><EFBFBD>
$arrow_buttons = TkFrame.new($arrow_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $arrow_demo
$arrow_demo = nil
@ -146,7 +147,7 @@ if TkWinfo.depth($arrow_canvas) > 1
$demo_arrowInfo.activeStyle = {'fill'=>'red', 'outline'=>'black', 'width'=>1}
else
$demo_arrowInfo.bigLineStyle = {'fill'=>'black',
'stipple'=>'@'+[$demo_dir, 'images', 'grey.25'].join(File::Separator)}
'stipple'=>'@'+[$demo_dir,'..','images','grey.25'].join(File::Separator)}
$demo_arrowInfo.boxStyle = {'fill'=>'', 'outline'=>'black', 'width'=>1}
$demo_arrowInfo.activeStyle = {'fill'=>'black','outline'=>'black','width'=>1}
end

View file

@ -18,7 +18,8 @@ $bind_demo = TkToplevel.new {|w|
# frame <20><><EFBFBD><EFBFBD>
TkFrame.new($bind_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $bind_demo
$bind_demo = nil

View file

@ -46,7 +46,8 @@ TkLabel.new($bitmap_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
# frame <20><><EFBFBD><EFBFBD>
$bitmap_buttons = TkFrame.new($bitmap_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $bitmap_demo
$bitmap_demo = nil

View file

@ -39,11 +39,11 @@ class Browse
}
# Set up bindings for the browser.
base.bind('Control-c',
proc{
base.destroy
base.bind('Destroy', proc{
Browse::BROWSE_WIN_COUNTER.value = \
Browse::BROWSE_WIN_COUNTER.to_i - 1})
Browse::BROWSE_WIN_COUNTER.to_i - 1
})
base.bind('Control-c', proc{base.destroy})
list.bind('Double-Button-1',
proc{TkSelection.get.each{|f| self.browse dir, f}})
end

View file

@ -27,7 +27,8 @@ msg.pack('side'=>'top')
# frame <20><><EFBFBD><EFBFBD>
$button_buttons = TkFrame.new($button_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $button_demo
$button_demo = nil

View file

@ -20,7 +20,7 @@ msg = TkLabel.new($check_demo) {
font $font
wraplength '4i'
justify 'left'
text "下には 3 つのチェックボタンが表示されています。クリックするとボタンの選択状態が変わり、Tcl 変数にそのボタンの状態を示す値を設定します。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
text "下には 3 つのチェックボタンが表示されています。クリックするとボタンの選択状態が変わり、Tcl 変数 ( TkVariable オブジェクトでアクセスできます ) にそのボタンの状態を示す値を設定します。現在の変数の値を見るには「変数参照」ボタンをクリックしてください。"
}
msg.pack('side'=>'top')
@ -32,7 +32,8 @@ sober = TkVariable.new(0)
# frame 生成
TkFrame.new($check_demo) {|frame|
TkButton.new(frame) {
text '了解'
#text '了解'
text '閉じる'
command proc{
tmppath = $check_demo
$check_demo = nil
@ -61,6 +62,6 @@ TkFrame.new($check_demo) {|frame|
# checkbutton 生成
[ TkCheckButton.new($check_demo, 'text'=>'ワイパー OK', 'variable'=>wipers),
TkCheckButton.new($check_demo, 'text'=>'ブレーキ OK', 'variable'=>brakes),
TkCheckButton.new($check_demo, 'text'=>'ドライバー素面', 'variable'=>sober)
TkCheckButton.new($check_demo, 'text'=>'運転手 素面', 'variable'=>sober)
].each{|w| w.relief('flat'); w.pack('side'=>'top', 'pady'=>2, 'anchor'=>'w')}

View file

@ -22,7 +22,8 @@ TkLabel.new($clrpick_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
# frame <20><><EFBFBD><EFBFBD>
TkFrame.new($clrpick_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $clrpick_demo
$clrpick_demo = nil

View file

@ -27,7 +27,8 @@ msg.pack('side'=>'top')
# frame <20><><EFBFBD><EFBFBD>
TkFrame.new($colors_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $colors_demo
$colors_demo = nil

View file

@ -24,7 +24,8 @@ TkLabel.new($cscroll_demo, 'font'=>$font, 'wraplength'=>'4i',
# frame <20><><EFBFBD><EFBFBD>
$cscroll_buttons = TkFrame.new($cscroll_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $cscroll_demo
$cscroll_demo = nil

View file

@ -30,7 +30,8 @@ TkLabel.new($ctext_demo, 'font'=>$font, 'wraplength'=>'5i', 'justify'=>'left',
# frame <20><><EFBFBD><EFBFBD>
$ctext_buttons = TkFrame.new($ctext_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $ctext_demo
$ctext_demo = nil

View file

@ -34,5 +34,5 @@ when 0
when 1
print "あなたは「キャンセル」を押しましたね。\n"
when 2
showCode dialog1
showCode 'dialog1'
end

View file

@ -37,6 +37,6 @@ when 0
when 1
print "あなたは「キャンセル」を押しましたね。\n"
when 2
showCode dialog2
showCode 'dialog2'
end

View file

@ -27,7 +27,8 @@ msg.pack('side'=>'top')
# frame <20><><EFBFBD><EFBFBD>
TkFrame.new($entry1_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $entry1_demo
$entry1_demo = nil

View file

@ -27,7 +27,8 @@ msg.pack('side'=>'top')
# frame <20><><EFBFBD><EFBFBD>
TkFrame.new($entry2_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $entry2_demo
$entry2_demo = nil

View file

@ -41,7 +41,7 @@ EOL
TkFrame.new($entry3_demo){|f|
pack(:side=>:bottom, :fill=>:x, :pady=>'2m')
TkButton.new(f, :text=>'λ²ò', :width=>15, :command=>proc{
TkButton.new(f, :text=>'閉じる', :width=>15, :command=>proc{
$entry3_demo.destroy
$entry3_demo = nil
}).pack(:side=>:left, :expand=>true)
@ -161,6 +161,8 @@ def validatePhoneChange(widget, vmode, idx, char)
widget.delete(idx)
widget.insert(idx, $phoneNumberMap[char] || char)
Tk.after_idle(proc{phoneSkipRight(widget, -1)})
# Tk.update(true) # Don't work 'update' inter validation callback.
# It depends on Tcl/Tk side (tested on Tcl/Tk8.5a1).
return true
end
return false

View file

@ -22,7 +22,8 @@ TkLabel.new($filebox_demo,'font'=>$font,'wraplength'=>'4i','justify'=>'left',
# frame <20><><EFBFBD><EFBFBD>
TkFrame.new($filebox_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $filebox_demo
$filebox_demo = nil

View file

@ -1595,7 +1595,8 @@ TkLabel.new($floor_demo, 'font'=>$font, 'wraplength'=>'8i', 'justify'=>'left',
# frame <20><><EFBFBD><EFBFBD>
$floor_buttons = TkFrame.new($floor_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $floor_demo
$floor_demo = nil

View file

@ -27,7 +27,8 @@ msg.pack('side'=>'top', 'fill'=>'x')
# frame <20><><EFBFBD><EFBFBD>
TkFrame.new($form_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $form_demo
$form_demo = nil

View file

@ -24,7 +24,8 @@ msg.pack('side'=>'top')
TkFrame.new($hscale_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc {
tmppath = $hscale_demo
$hscale_demo = nil

View file

@ -27,7 +27,8 @@ msg.pack('side'=>'top')
# frame À¸À®
TkFrame.new($icon_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text 'λ²ò'
text 'ÊĤ¸¤ë'
command proc{
tmppath = $icon_demo
$icon_demo = nil
@ -44,15 +45,16 @@ TkFrame.new($icon_demo) {|frame|
# image À¸À®
flagup = \
TkBitmapImage.new('file'=>[$demo_dir,
'images','flagup.bmp'].join(File::Separator),
TkBitmapImage.new('file'=>[$demo_dir,'..',
'images','flagup.xbm'].join(File::Separator),
'maskfile'=>\
[$demo_dir,'images','flagup.bmp'].join(File::Separator))
[$demo_dir,'..','images','flagup.xbm'].join(File::Separator))
flagdown = \
TkBitmapImage.new('file'=>[$demo_dir,
'images','flagdown.bmp'].join(File::Separator),
TkBitmapImage.new('file'=>[$demo_dir,'..',
'images','flagdown.xbm'].join(File::Separator),
'maskfile'=>\
[$demo_dir,'images','flagdown.bmp'].join(File::Separator))
[$demo_dir,'..',
'images','flagdown.xbm'].join(File::Separator))
# ÊÑ¿ôÀ¸À®
letters = TkVariable.new
@ -61,13 +63,15 @@ letters = TkVariable.new
TkFrame.new($icon_demo, 'borderwidth'=>10){|w|
TkFrame.new(w) {|f|
TkRadioButton.new(f){
bitmap '@' + [$demo_dir,'images','letters.bmp'].join(File::Separator)
bitmap '@' + [$demo_dir,'..',
'images','letters.xbm'].join(File::Separator)
variable letters
value 'full'
}.pack('side'=>'top', 'expand'=>'yes')
TkRadioButton.new(f){
bitmap '@' + [$demo_dir,'images','noletter.bmp'].join(File::Separator)
bitmap '@' + [$demo_dir,'..',
'images','noletter.xbm'].join(File::Separator)
variable letters
value 'empty'
}.pack('side'=>'top', 'expand'=>'yes')
@ -82,7 +86,8 @@ TkFrame.new($icon_demo, 'borderwidth'=>10){|w|
}.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')
TkCheckButton.new(w) {
bitmap '@' + [$demo_dir,'images','letters.bmp'].join(File::Separator)
bitmap '@' + [$demo_dir,'..',
'images','letters.xbm'].join(File::Separator)
indicatoron 0
selectcolor 'SeaGreen1'
}.pack('side'=>'left', 'expand'=>'yes', 'padx'=>'5m')

View file

@ -27,7 +27,8 @@ msg.pack('side'=>'top')
# frame <20><><EFBFBD><EFBFBD>
TkFrame.new($image1_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $image1_demo
$image1_demo = nil
@ -44,10 +45,10 @@ TkFrame.new($image1_demo) {|frame|
# image <20><><EFBFBD><EFBFBD>
image1a = \
TkPhotoImage.new('file'=>[$demo_dir,
TkPhotoImage.new('file'=>[$demo_dir,'..',
'images','earth.gif'].join(File::Separator))
image1b = \
TkPhotoImage.new('file'=>[$demo_dir,
TkPhotoImage.new('file'=>[$demo_dir,'..',
'images','earthris.gif'].join(File::Separator))
# label <20><><EFBFBD><EFBFBD>

View file

@ -27,7 +27,8 @@ msg.pack('side'=>'top')
# frame 으윙
TkFrame.new($image2_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text '了解'
text '閉じる'
command proc{
tmppath = $image2_demo
$image2_demo = nil
@ -43,7 +44,7 @@ TkFrame.new($image2_demo) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# 揀웃으윙
$dirName = TkVariable.new([$demo_dir,'images'].join(File::Separator))
$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
# image 으윙
$image2a = TkPhotoImage.new

View file

@ -20,29 +20,29 @@ $image3_demo = TkToplevel.new {|w|
}
#
def loadDir(w)
def loadDir3(w)
w.delete(0,'end')
Dir.glob([$dirName,'*'].join(File::Separator)).sort.each{|f|
w.insert('end',File.basename(f))
}
end
# selectAndLoadDir --
# selectAndLoadDir3 --
# This procedure pops up a dialog to ask for a directory to load into
# the listobx and (if the user presses OK) reloads the directory
# listbox from the directory named in the demo's entry.
#
# Arguments:
# w - Name of the toplevel window of the demo.
def selectAndLoadDir(w, lbox)
def selectAndLoadDir3(w, lbox)
dir = Tk.chooseDirectory(:initialdir=>$dirName, :parent=>w, :mustexist=>true)
if dir.length > 0
$dirName.value = dir
loadDir(lbox)
loadDir3(lbox)
end
end
def loadImage(w,x,y)
def loadImage3(w,x,y)
$image3a.file([$dirName, w.get("@#{x},#{y}")].join(File::Separator))
end
@ -59,7 +59,8 @@ msg.pack('side'=>'top')
# frame
TkFrame.new($image3_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text 'λ²ò'
text 'ÊĤ¸¤ë'
command proc{
tmppath = $image3_demo
$image3_demo = nil
@ -75,7 +76,7 @@ TkFrame.new($image3_demo) {|frame|
}.pack('side'=>'bottom', 'fill'=>'x', 'pady'=>'2m')
# variable
$dirName = TkVariable.new([$demo_dir,'images'].join(File::Separator))
$dirName = TkVariable.new([$demo_dir,'..','images'].join(File::Separator))
# image
begin
@ -96,16 +97,16 @@ image3_lbx = TkListbox.new(image3_ff, :width=>20, :height=>10) {
yscrollbar(TkScrollbar.new(image3_ff).pack(:side=>:left, :fill=>:y,
:expand=>true))
insert(0, *(%w(earth.gif earthris.gif teapot.ppm)))
bind('Double-1', proc{|x,y| loadImage(self, x, y)}, '%x %y')
bind('Double-1', proc{|x,y| loadImage3(self, x, y)}, '%x %y')
}
image3_ent = TkEntry.new(image3_df, :width=>30, :textvariable=>$dirName){
pack(:side=>:left, :fill=>:both, :padx=>'2m', :pady=>'2m', :expand=>true)
bind('Return', proc{loadDir(image3_lbx)})
bind('Return', proc{loadDir3(image3_lbx)})
}
TkButton.new(image3_df, :pady=>0, :padx=>'2m', :text=>"¥Ç¥£¥ì¥¯¥È¥êÁªÂò",
:command=>proc{selectAndLoadDir(image3_ent, image3_lbx)}) {
:command=>proc{selectAndLoadDir3(image3_ent, image3_lbx)}) {
pack(:side=>:left, :fill=>:y, :padx=>[0, '2m'], :pady=>'2m')
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View file

@ -1,173 +0,0 @@
#define face_width 108
#define face_height 144
#define face_x_hot 48
#define face_y_hot 80
static char face_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x09,
0x20, 0x80, 0x24, 0x05, 0x00, 0x80, 0x08, 0x00, 0x00, 0x00, 0x00, 0x88,
0x24, 0x20, 0x80, 0x24, 0x00, 0x00, 0x00, 0x10, 0x80, 0x04, 0x00, 0x01,
0x00, 0x01, 0x40, 0x0a, 0x09, 0x00, 0x92, 0x04, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x10, 0x40, 0x12, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x84,
0x24, 0x40, 0x22, 0xa8, 0x02, 0x14, 0x84, 0x92, 0x40, 0x42, 0x12, 0x04,
0x10, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x11, 0x00, 0x12, 0x00,
0x40, 0x02, 0x00, 0x20, 0x00, 0x08, 0x00, 0xaa, 0x02, 0x54, 0x85, 0x24,
0x00, 0x10, 0x12, 0x00, 0x00, 0x81, 0x44, 0x00, 0x90, 0x5a, 0x00, 0xea,
0x1b, 0x00, 0x80, 0x40, 0x40, 0x02, 0x00, 0x08, 0x00, 0x20, 0xa2, 0x05,
0x8a, 0xb4, 0x6e, 0x45, 0x12, 0x04, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02,
0xa8, 0x92, 0x00, 0xda, 0x5f, 0x10, 0x00, 0x10, 0xa1, 0x04, 0x20, 0x41,
0x02, 0x00, 0x5a, 0x25, 0xa0, 0xff, 0xfb, 0x05, 0x41, 0x02, 0x04, 0x00,
0x00, 0x08, 0x40, 0x80, 0xec, 0x9b, 0xec, 0xfe, 0x7f, 0x01, 0x04, 0x20,
0x90, 0x02, 0x04, 0x00, 0x08, 0x20, 0xfb, 0x2e, 0xf5, 0xff, 0xff, 0x57,
0x00, 0x04, 0x02, 0x00, 0x00, 0x20, 0x01, 0xc1, 0x6e, 0xab, 0xfa, 0xff,
0xff, 0x05, 0x90, 0x20, 0x48, 0x02, 0x00, 0x04, 0x20, 0xa8, 0xdf, 0xb5,
0xfe, 0xff, 0xff, 0x0b, 0x01, 0x00, 0x01, 0x00, 0x80, 0x80, 0x04, 0xe0,
0xbb, 0xef, 0xff, 0xff, 0x7f, 0x01, 0x00, 0x04, 0x48, 0x02, 0x00, 0x20,
0x80, 0xf4, 0x6f, 0xfb, 0xff, 0xff, 0xff, 0x20, 0x90, 0x40, 0x02, 0x00,
0x00, 0x04, 0x08, 0xb8, 0xf6, 0xff, 0xff, 0xdf, 0xbe, 0x12, 0x45, 0x10,
0x90, 0x04, 0x90, 0x00, 0x22, 0xfa, 0xff, 0xff, 0xff, 0xbb, 0xd7, 0xe9,
0x3a, 0x02, 0x02, 0x00, 0x04, 0x90, 0x80, 0xfe, 0xdf, 0xf6, 0xb7, 0xef,
0xbe, 0x56, 0x57, 0x40, 0x48, 0x09, 0x00, 0x04, 0x00, 0xfa, 0xf5, 0xdf,
0xed, 0x5a, 0xd5, 0xea, 0xbd, 0x09, 0x00, 0x00, 0x40, 0x00, 0x92, 0xfe,
0xbf, 0x7d, 0xb7, 0x6a, 0x55, 0xbf, 0xf7, 0x02, 0x11, 0x01, 0x00, 0x91,
0x00, 0xff, 0xff, 0xaf, 0x55, 0x55, 0x5b, 0xeb, 0xef, 0x22, 0x04, 0x04,
0x04, 0x00, 0xa4, 0xff, 0xf7, 0xad, 0xaa, 0xaa, 0xaa, 0xbe, 0xfe, 0x03,
0x20, 0x00, 0x10, 0x44, 0x80, 0xff, 0x7f, 0x55, 0x12, 0x91, 0x2a, 0xeb,
0xbf, 0x0b, 0x82, 0x02, 0x00, 0x00, 0xd1, 0x7f, 0xdf, 0xa2, 0xa4, 0x54,
0x55, 0xfd, 0xfd, 0x47, 0x08, 0x08, 0x00, 0x21, 0xe4, 0xff, 0x37, 0x11,
0x09, 0xa5, 0xaa, 0xb6, 0xff, 0x0d, 0x80, 0x00, 0x00, 0x04, 0xd0, 0xff,
0x4f, 0x44, 0x20, 0x48, 0x55, 0xfb, 0xff, 0x27, 0x11, 0x02, 0x40, 0x40,
0xe2, 0xfb, 0x15, 0x11, 0x4a, 0x55, 0x4a, 0x7d, 0xf7, 0x0f, 0x00, 0x00,
0x04, 0x08, 0xf8, 0xdf, 0x52, 0x44, 0x01, 0x52, 0xb5, 0xfa, 0xff, 0x0f,
0x49, 0x02, 0x00, 0x02, 0xe9, 0xf6, 0x0a, 0x11, 0xa4, 0x88, 0x4a, 0x6d,
0xff, 0x5f, 0x00, 0x00, 0x10, 0x20, 0xf0, 0x2f, 0x21, 0x44, 0x10, 0x52,
0xb5, 0xfa, 0xff, 0x0f, 0x44, 0x04, 0x80, 0x08, 0xf8, 0xab, 0x8a, 0x00,
0x81, 0xa4, 0xd4, 0xd6, 0xfe, 0x2f, 0x00, 0x00, 0x04, 0x40, 0xb5, 0x2d,
0x21, 0x08, 0x04, 0x90, 0xaa, 0xfa, 0xff, 0x1f, 0x11, 0x01, 0x00, 0x04,
0xf0, 0x57, 0x0a, 0x22, 0x40, 0x4a, 0xda, 0x5e, 0xfb, 0x1f, 0x40, 0x00,
0x40, 0x20, 0xba, 0x95, 0x90, 0x00, 0x01, 0xa0, 0xaa, 0xea, 0xff, 0x5f,
0x02, 0x02, 0x00, 0x01, 0xe8, 0x57, 0x05, 0x00, 0x00, 0x12, 0xd5, 0xfe,
0xfd, 0x1f, 0x48, 0x00, 0x04, 0x48, 0x7a, 0x95, 0x08, 0x02, 0x10, 0x40,
0xaa, 0x55, 0xf7, 0x1f, 0x00, 0x09, 0x20, 0x00, 0xf8, 0x57, 0x22, 0x10,
0x00, 0x28, 0xa9, 0xfa, 0xff, 0x5f, 0x02, 0x00, 0x00, 0x49, 0xdd, 0x29,
0x01, 0x00, 0x80, 0x80, 0xaa, 0xd7, 0xff, 0x0f, 0x10, 0x00, 0x08, 0x00,
0xf8, 0x96, 0x08, 0x00, 0x00, 0x20, 0x54, 0xfa, 0xee, 0x3f, 0x81, 0x04,
0x40, 0x24, 0xfe, 0x55, 0x82, 0x00, 0x00, 0x82, 0xd2, 0xad, 0xff, 0x0f,
0x08, 0x00, 0x04, 0x80, 0x6c, 0x97, 0x00, 0x00, 0x02, 0x20, 0xa9, 0xf6,
0xdf, 0x5f, 0x00, 0x02, 0x20, 0x09, 0xfa, 0x49, 0x12, 0x00, 0x20, 0x84,
0x54, 0xdb, 0xfe, 0x1f, 0x91, 0x00, 0x00, 0x00, 0xf8, 0x2b, 0x00, 0x20,
0x00, 0x40, 0xa4, 0xf6, 0xbb, 0x1f, 0x04, 0x00, 0x44, 0x92, 0x7e, 0x95,
0x02, 0x00, 0x00, 0x89, 0xaa, 0xdd, 0xff, 0x1f, 0x20, 0x09, 0x10, 0x00,
0xf4, 0x57, 0x20, 0x01, 0x08, 0x20, 0xa9, 0x76, 0xff, 0x5f, 0x02, 0x00,
0x00, 0x21, 0xfc, 0x4a, 0x05, 0x00, 0x01, 0x80, 0x54, 0xdb, 0xff, 0x1e,
0x08, 0x02, 0x04, 0x08, 0xf9, 0x2b, 0x00, 0x00, 0x40, 0x28, 0xd2, 0xf6,
0xff, 0xbf, 0x80, 0x00, 0x90, 0x00, 0xbc, 0x92, 0x08, 0x10, 0x00, 0x82,
0x54, 0xdb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x44, 0xf9, 0x55, 0x02, 0x01,
0x00, 0x20, 0xaa, 0xbd, 0xfd, 0x3f, 0x08, 0x04, 0x04, 0x10, 0xf4, 0x2a,
0x01, 0x00, 0x22, 0x80, 0xd4, 0xf6, 0xff, 0x5f, 0x82, 0x00, 0x40, 0x02,
0xf8, 0x55, 0x20, 0x00, 0x00, 0x50, 0x6a, 0xdf, 0xfe, 0x3f, 0x00, 0x00,
0x00, 0x48, 0xe9, 0x4a, 0x05, 0x08, 0x00, 0xa5, 0xd5, 0xf5, 0xff, 0x3f,
0x10, 0x01, 0x10, 0x01, 0xb0, 0xab, 0x92, 0x02, 0x40, 0xf8, 0xbf, 0xde,
0xfe, 0x5f, 0x02, 0x04, 0x04, 0x48, 0xfa, 0xd4, 0x6f, 0x20, 0x84, 0xef,
0xff, 0xfb, 0xff, 0x1f, 0x20, 0x00, 0x00, 0x00, 0xe0, 0xed, 0xbf, 0x0b,
0xa1, 0x7e, 0xff, 0xbf, 0xfd, 0x5f, 0x04, 0x01, 0x20, 0x49, 0xd2, 0xfb,
0xfe, 0x55, 0xd4, 0xff, 0xff, 0xf6, 0xff, 0x07, 0x00, 0x04, 0x00, 0x00,
0xc0, 0xaa, 0xfb, 0x2b, 0xa2, 0xfe, 0xff, 0xdf, 0xee, 0x1f, 0x91, 0x00,
0x82, 0xa4, 0xa4, 0xf5, 0xff, 0x57, 0xd5, 0xff, 0xbf, 0xfd, 0xff, 0x4d,
0x00, 0x00, 0x20, 0x00, 0x88, 0x5b, 0xff, 0x2f, 0x69, 0xff, 0xff, 0xdb,
0xfe, 0x1f, 0x24, 0x02, 0x00, 0x49, 0xa2, 0xd6, 0xff, 0x5f, 0xea, 0xff,
0x7f, 0x7f, 0x7f, 0x0d, 0x00, 0x00, 0x10, 0x00, 0x40, 0xab, 0xf7, 0xbb,
0xf0, 0xdf, 0xff, 0xd5, 0xff, 0xbf, 0x82, 0x04, 0x42, 0x24, 0x91, 0xd5,
0xaa, 0xae, 0xd4, 0xaa, 0x52, 0x7b, 0xff, 0x15, 0x08, 0x00, 0x00, 0x01,
0x04, 0x55, 0xd5, 0x55, 0x70, 0x5b, 0x75, 0xdd, 0xdf, 0x1f, 0x40, 0x00,
0x08, 0x48, 0xa0, 0x4a, 0xa9, 0x56, 0xea, 0x56, 0xad, 0x6a, 0x7d, 0x9b,
0x04, 0x01, 0x00, 0x02, 0x42, 0x2a, 0xd5, 0xaa, 0xa8, 0xaa, 0xaa, 0xfa,
0xdf, 0x2f, 0x10, 0x04, 0x22, 0x48, 0x08, 0x45, 0x2a, 0x15, 0x68, 0x55,
0x55, 0xd7, 0x76, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x40, 0x2a, 0x80, 0xa0,
0xb2, 0x09, 0x48, 0xb9, 0xdf, 0x17, 0x22, 0x01, 0x00, 0x24, 0x45, 0x8a,
0x24, 0x4a, 0x54, 0x51, 0x91, 0xf6, 0x6e, 0x4b, 0x00, 0x04, 0x90, 0x00,
0x80, 0x52, 0x00, 0x20, 0x69, 0x05, 0xa4, 0xaa, 0xff, 0x1e, 0x48, 0x00,
0x02, 0x92, 0x08, 0x05, 0x81, 0x94, 0xd4, 0x92, 0x40, 0xfd, 0xb6, 0x8b,
0x00, 0x01, 0x40, 0x00, 0x82, 0x54, 0x00, 0x48, 0x68, 0x05, 0x90, 0xa4,
0xef, 0x06, 0x24, 0x00, 0x08, 0x12, 0x10, 0x05, 0x00, 0x10, 0xb5, 0x01,
0x42, 0xfb, 0xbf, 0x43, 0x00, 0x09, 0x00, 0x40, 0x81, 0xa8, 0x08, 0x4a,
0xaa, 0x96, 0x90, 0xac, 0x6d, 0x15, 0x22, 0x00, 0x20, 0x09, 0x04, 0x15,
0x80, 0x28, 0xdc, 0x01, 0x24, 0xfb, 0xbf, 0x01, 0x80, 0x04, 0x09, 0x00,
0x40, 0x48, 0x02, 0x45, 0xb2, 0x2e, 0x41, 0x6d, 0xef, 0x05, 0x11, 0x00,
0x40, 0x52, 0x02, 0x15, 0x29, 0x2a, 0xac, 0x42, 0x54, 0xfb, 0x3b, 0x51,
0x84, 0x00, 0x08, 0x00, 0x20, 0x54, 0x80, 0x05, 0xb5, 0x3d, 0xa2, 0xb6,
0xdf, 0x00, 0x20, 0x04, 0x20, 0x49, 0x89, 0xa8, 0x6a, 0x29, 0xac, 0xd6,
0x54, 0xff, 0x3f, 0x84, 0x00, 0x01, 0x04, 0x10, 0x00, 0x94, 0xa8, 0x56,
0xda, 0x5f, 0xab, 0xd5, 0x1e, 0x10, 0x48, 0x00, 0x90, 0x82, 0x48, 0xa8,
0xb2, 0xac, 0xfd, 0x55, 0xd5, 0xfe, 0x9f, 0x80, 0x00, 0x0a, 0x02, 0x08,
0x02, 0x55, 0x5a, 0x75, 0xff, 0xaf, 0xb6, 0xf7, 0x2d, 0x12, 0x92, 0x00,
0x10, 0x20, 0x10, 0xa8, 0x54, 0xd5, 0xbf, 0x5d, 0xad, 0xdd, 0x0f, 0x00,
0x00, 0x04, 0x40, 0x09, 0x84, 0xa8, 0xaa, 0x5a, 0xed, 0xeb, 0x6a, 0xff,
0x9f, 0xa4, 0x24, 0x01, 0x02, 0xa0, 0x20, 0x50, 0x55, 0xd5, 0xbe, 0xae,
0xad, 0xfd, 0x16, 0x00, 0x10, 0x04, 0x20, 0x0a, 0x08, 0xb4, 0xaa, 0x95,
0xaa, 0x7b, 0xb7, 0xdb, 0x5f, 0x92, 0x04, 0x01, 0x84, 0x20, 0x21, 0x51,
0xd5, 0x2a, 0xa9, 0xee, 0xd5, 0xfe, 0x0d, 0x00, 0x20, 0x04, 0x10, 0x00,
0x08, 0x50, 0xe9, 0xd7, 0xd4, 0xfb, 0xb5, 0xff, 0x9f, 0x24, 0x09, 0x01,
0x42, 0x4a, 0xa2, 0x64, 0xd5, 0x55, 0x7b, 0x7f, 0xda, 0x7d, 0x4f, 0x00,
0x20, 0x04, 0x00, 0x80, 0x00, 0xa0, 0x2a, 0x13, 0x84, 0x6a, 0x55, 0xff,
0x1d, 0x48, 0x8a, 0x00, 0x94, 0x24, 0x8a, 0xc8, 0xaa, 0x42, 0x20, 0x5d,
0xf5, 0xff, 0x5f, 0x01, 0x00, 0x02, 0x01, 0x00, 0x20, 0xa2, 0x4a, 0x1a,
0x82, 0x56, 0xda, 0xbd, 0x3f, 0x92, 0x92, 0x00, 0x90, 0x92, 0x00, 0x40,
0x95, 0x6a, 0xf4, 0x55, 0x6d, 0xff, 0xd6, 0x00, 0x00, 0x0a, 0x04, 0x20,
0x14, 0x49, 0x4b, 0xaa, 0xaa, 0x56, 0xf5, 0xff, 0xbf, 0xab, 0xa4, 0x00,
0x20, 0x89, 0x40, 0x80, 0xaa, 0xaa, 0xaa, 0xaa, 0xde, 0xbf, 0xeb, 0x03,
0x00, 0x02, 0x04, 0x02, 0x0a, 0x10, 0x2b, 0x2a, 0x55, 0x5b, 0xf5, 0xff,
0xd7, 0x2f, 0x92, 0x00, 0x10, 0x28, 0x21, 0x01, 0x56, 0x95, 0xa0, 0x56,
0xdf, 0xef, 0xea, 0x87, 0x40, 0x0a, 0x42, 0x41, 0x00, 0x90, 0xaa, 0x52,
0xb6, 0xad, 0xfa, 0xff, 0xd5, 0x2f, 0x14, 0x00, 0x00, 0x04, 0x95, 0x04,
0xaa, 0xac, 0x55, 0x6b, 0xff, 0xb7, 0xea, 0x9f, 0x40, 0x02, 0x28, 0x51,
0x00, 0x40, 0x58, 0xd5, 0xda, 0xd6, 0x6e, 0x7f, 0xf9, 0x3f, 0x12, 0x04,
0x02, 0x04, 0x49, 0x25, 0x55, 0xaa, 0x77, 0xab, 0xff, 0x2b, 0xfd, 0x3f,
0x48, 0x01, 0x20, 0x41, 0x00, 0x00, 0x58, 0xa9, 0xda, 0xea, 0xfd, 0xaf,
0xfa, 0xff, 0x02, 0x04, 0x08, 0x14, 0x29, 0x49, 0x52, 0x55, 0x55, 0x55,
0xff, 0x8d, 0xfe, 0x3f, 0xa8, 0x00, 0x02, 0x41, 0x00, 0x02, 0xa0, 0xa2,
0xaa, 0xea, 0xff, 0x53, 0xfd, 0xff, 0x02, 0x04, 0x50, 0x04, 0x25, 0xa8,
0x54, 0x49, 0x52, 0xb5, 0xbf, 0x8a, 0xfe, 0xff, 0xa9, 0x08, 0x04, 0x50,
0x80, 0x02, 0xa1, 0x2a, 0x95, 0xea, 0xff, 0xa1, 0xff, 0xff, 0x03, 0x02,
0x90, 0x02, 0x09, 0x08, 0x44, 0x49, 0x52, 0xbd, 0x7f, 0xca, 0xff, 0xff,
0x2b, 0x09, 0x04, 0x48, 0x40, 0x82, 0x90, 0x56, 0xa9, 0xf6, 0xbf, 0xd0,
0xff, 0xff, 0x47, 0x00, 0x50, 0x02, 0x15, 0x11, 0x40, 0x95, 0xaa, 0xfd,
0x2f, 0xe9, 0xff, 0xff, 0x8f, 0x0a, 0x84, 0x50, 0x40, 0x84, 0x14, 0xaa,
0x6a, 0xff, 0x5f, 0xf2, 0xff, 0xff, 0x7f, 0x00, 0x10, 0x02, 0x09, 0x10,
0x40, 0x7d, 0xf7, 0xff, 0x0b, 0xfc, 0xff, 0xff, 0xaf, 0x02, 0x84, 0x50,
0x42, 0x85, 0x12, 0xd0, 0xdd, 0xff, 0xa7, 0xf2, 0xff, 0xff, 0xff, 0x04,
0x00, 0x0a, 0x08, 0x10, 0x48, 0xf8, 0xff, 0xff, 0x0a, 0xfe, 0xff, 0xff,
0x7f, 0x03, 0xa4, 0x80, 0xa2, 0x8a, 0x02, 0x68, 0xff, 0xff, 0x52, 0xfd,
0xff, 0xff, 0xff, 0x07, 0x00, 0x2a, 0x08, 0x20, 0x28, 0xdc, 0xff, 0x5f,
0x05, 0xff, 0xff, 0xff, 0xff, 0x0d, 0x92, 0x40, 0x22, 0x09, 0x02, 0xea,
0xfb, 0xaf, 0x48, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x12, 0x81, 0xa0,
0x48, 0x9c, 0x6e, 0x93, 0xa2, 0xff, 0xff, 0xff, 0xff, 0x07, 0xa8, 0x40,
0x28, 0x0a, 0x02, 0x74, 0xb5, 0x45, 0x81, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x02, 0x0a, 0x81, 0x20, 0x08, 0xae, 0xaa, 0x90, 0xe8, 0xff, 0xff, 0xff,
0xff, 0x0f, 0x90, 0x40, 0x28, 0x88, 0x12, 0x58, 0x15, 0x50, 0xd0, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x44, 0x0a, 0x41, 0x21, 0x08, 0xae, 0x04, 0x14,
0xf0, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40, 0x14, 0x88, 0x04, 0xba,
0x02, 0x28, 0xe8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x42, 0x15, 0x41, 0x21,
0x05, 0xad, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x40,
0x24, 0x8a, 0x0e, 0x36, 0x00, 0x0a, 0xf4, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x42, 0x25, 0x90, 0xd0, 0x8b, 0xc2, 0x41, 0x05, 0xfc, 0xff, 0xff, 0xff,
0xff, 0x0f, 0x10, 0x08, 0x05, 0xe8, 0x8e, 0x58, 0x80, 0x02, 0xfa, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x4a, 0x20, 0xa8, 0xba, 0x0b, 0x2b, 0x51, 0x01,
0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x8a, 0x02, 0xe8, 0xaf, 0x84,
0x90, 0x04, 0xfd, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x52, 0x21, 0x54, 0xbf,
0x1f, 0x15, 0xa5, 0x02, 0xfe, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x08,
0x01, 0xfa, 0xb6, 0xa4, 0x52, 0x40, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x4a, 0xa2, 0x54, 0xef, 0x5f, 0x4b, 0xa4, 0x80, 0xff, 0xff, 0xff, 0xff,
0xff, 0x0f, 0x80, 0x10, 0x82, 0xfe, 0xbf, 0x92, 0x52, 0x42, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x12, 0x42, 0xa8, 0xbf, 0x1f, 0x24, 0x80, 0xa0,
0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28, 0x8a, 0xf7, 0x37, 0x80,
0x52, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x10, 0x82, 0xe0, 0xff,
0x1f, 0x00, 0x20, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x84, 0x28,
0xca, 0xff, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f,
0x10, 0x42, 0xf0, 0xfd, 0x1b, 0x00, 0x50, 0xf0, 0xff, 0xff, 0xff, 0xff,
0xff, 0x0f, 0xa4, 0x10, 0xc5, 0xff, 0x1f, 0x00, 0x00, 0xe0, 0xff, 0xff,
0xff, 0xff, 0xff, 0x0f, 0x00, 0x22, 0xf8, 0xff, 0x0e, 0x00, 0x00, 0xf0,
0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xaa, 0x88, 0xe2, 0xff, 0x0f, 0x10,
0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x25, 0xfa, 0xff,
0x0f, 0x01, 0x11, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xfb,
0xfb, 0xff, 0x7f, 0x5d, 0xd5, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f};

View file

@ -1,27 +0,0 @@
#define flagdown_width 48
#define flagdown_height 48
static char flagdown_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00,
0x00, 0x00, 0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xe1, 0x00, 0x00,
0x00, 0x00, 0x70, 0x80, 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0x00,
0x00, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04,
0x00, 0x00, 0x03, 0x00, 0x06, 0x06, 0x00, 0x80, 0x01, 0x00, 0x06, 0x07,
0x00, 0xc0, 0x1f, 0x00, 0x87, 0x07, 0x00, 0xe0, 0x7f, 0x80, 0xc7, 0x07,
0x00, 0x70, 0xe0, 0xc0, 0xe5, 0x07, 0x00, 0x38, 0x80, 0xe1, 0x74, 0x07,
0x00, 0x18, 0x80, 0x71, 0x3c, 0x07, 0x00, 0x0c, 0x00, 0x3b, 0x1e, 0x03,
0x00, 0x0c, 0x00, 0x1f, 0x0f, 0x00, 0x00, 0x86, 0x1f, 0x8e, 0x07, 0x00,
0x00, 0x06, 0x06, 0xc6, 0x05, 0x00, 0x00, 0x06, 0x00, 0xc6, 0x05, 0x00,
0x00, 0x06, 0x00, 0xc6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00,
0x7f, 0x06, 0x00, 0x06, 0xe4, 0xff, 0x00, 0x06, 0x00, 0x06, 0x04, 0x00,
0x00, 0x06, 0x00, 0x06, 0x04, 0x00, 0x00, 0x06, 0x00, 0x06, 0x06, 0x00,
0x00, 0x06, 0x00, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00,
0x00, 0x06, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x06, 0x00, 0x66, 0x00, 0x00,
0x00, 0x06, 0x00, 0x36, 0x00, 0x00, 0x00, 0x06, 0x00, 0x3e, 0x00, 0x00,
0x00, 0xfe, 0xff, 0x2f, 0x00, 0x00, 0x00, 0xfc, 0xff, 0x27, 0x00, 0x00,
0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00,
0xf7, 0xbf, 0x8e, 0xfc, 0xdf, 0xf8, 0x9d, 0xeb, 0x9b, 0x76, 0xd2, 0x7a,
0x46, 0x30, 0xe2, 0x0f, 0xe1, 0x47, 0x55, 0x84, 0x48, 0x11, 0x84, 0x19};

View file

@ -1,27 +0,0 @@
#define flagup_width 48
#define flagup_height 48
static char flagup_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00,
0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xef, 0x6a, 0x00,
0x00, 0x00, 0xc0, 0x7b, 0x75, 0x00, 0x00, 0x00, 0xe0, 0xe0, 0x6a, 0x00,
0x00, 0x00, 0x30, 0x60, 0x75, 0x00, 0x00, 0x00, 0x18, 0xe0, 0x7f, 0x00,
0x00, 0x00, 0x0c, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x06, 0xe0, 0x04, 0x00,
0x00, 0x00, 0x03, 0xe0, 0x04, 0x00, 0x00, 0x80, 0x01, 0xe0, 0x06, 0x00,
0x00, 0xc0, 0x1f, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x7f, 0xe0, 0x07, 0x00,
0x00, 0x70, 0xe0, 0xe0, 0x05, 0x00, 0x00, 0x38, 0x80, 0xe1, 0x04, 0x00,
0x00, 0x18, 0x80, 0xf1, 0x04, 0x00, 0x00, 0x0c, 0x00, 0xfb, 0x04, 0x00,
0x00, 0x0c, 0x00, 0xff, 0x04, 0x00, 0x00, 0x86, 0x1f, 0xee, 0x04, 0x00,
0x00, 0x06, 0x06, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0xe6, 0x04, 0x00,
0x00, 0x06, 0x00, 0xe6, 0x04, 0x00, 0x00, 0x06, 0x00, 0x66, 0x04, 0x00,
0x7f, 0x56, 0x52, 0x06, 0xe4, 0xff, 0x00, 0x76, 0x55, 0x06, 0x04, 0x00,
0x00, 0x56, 0x57, 0x06, 0x04, 0x00, 0x00, 0x56, 0x55, 0x06, 0x06, 0x00,
0x00, 0x56, 0xd5, 0x06, 0x03, 0x00, 0x00, 0x06, 0x00, 0x86, 0x01, 0x00,
0x54, 0x06, 0x00, 0xc6, 0x54, 0x55, 0xaa, 0x06, 0x00, 0x66, 0xaa, 0x2a,
0x54, 0x06, 0x00, 0x36, 0x55, 0x55, 0xaa, 0x06, 0x00, 0xbe, 0xaa, 0x2a,
0x54, 0xfe, 0xff, 0x6f, 0x55, 0x55, 0xaa, 0xfc, 0xff, 0xa7, 0xaa, 0x2a,
0x54, 0x01, 0x88, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
0x54, 0x55, 0x8d, 0x60, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa0, 0xaa, 0x2a,
0x54, 0x55, 0x8d, 0x50, 0x55, 0x55, 0xaa, 0xaa, 0x8a, 0xa8, 0xaa, 0x2a,
0x54, 0x55, 0x95, 0x54, 0x55, 0x55, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x2a,
0x54, 0x55, 0x55, 0x55, 0x55, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View file

@ -1,6 +0,0 @@
#define grey_width 16
#define grey_height 16
static char grey_bits[] = {
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44};

View file

@ -1,6 +0,0 @@
#define grey_width 16
#define grey_height 16
static char grey_bits[] = {
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44,
0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44};

View file

@ -1,6 +0,0 @@
#define grey_width 16
#define grey_height 16
static char grey_bits[] = {
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa,
0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa};

View file

@ -1,27 +0,0 @@
#define letters_width 48
#define letters_height 48
static char letters_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20,
0x00, 0xfa, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a,
0x00, 0x3a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2e,
0xe0, 0xff, 0xff, 0xff, 0xff, 0x21, 0x20, 0x00, 0x00, 0x00, 0x00, 0x21,
0xa0, 0x03, 0x00, 0x00, 0x70, 0x21, 0x20, 0x00, 0x00, 0x00, 0x50, 0x21,
0xa0, 0x1f, 0x00, 0x00, 0x50, 0x21, 0x20, 0x00, 0x00, 0x00, 0x70, 0x21,
0xfe, 0xff, 0xff, 0xff, 0x0f, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21,
0xfa, 0x01, 0x00, 0x80, 0x0b, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0a, 0x21,
0xba, 0x01, 0x00, 0x80, 0x0a, 0x21, 0x02, 0x00, 0x00, 0x80, 0x0b, 0x21,
0x3a, 0x00, 0x00, 0x00, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x21,
0x02, 0xc0, 0xfb, 0x03, 0x08, 0x21, 0x02, 0x00, 0x00, 0x00, 0x08, 0x3f,
0x02, 0xc0, 0xbd, 0x0f, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
0x02, 0xc0, 0x7f, 0x7b, 0x08, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x01,
0x02, 0x00, 0x00, 0x00, 0xf8, 0x01, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00,
0xfe, 0xff, 0xff, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

View file

@ -1,27 +0,0 @@
#define noletters_width 48
#define noletters_height 48
static char noletters_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00,
0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,
0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00,
0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01,
0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0xe0, 0x07,
0xe0, 0x01, 0x00, 0x00, 0xf0, 0x0f, 0xe0, 0x00, 0x00, 0x00, 0x78, 0x0e,
0xf0, 0x00, 0x00, 0x00, 0x3c, 0x1e, 0x70, 0x00, 0x00, 0x00, 0x1e, 0x1c,
0x38, 0x00, 0x00, 0x00, 0x0f, 0x38, 0x38, 0x00, 0x00, 0x80, 0x07, 0x38,
0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x1c, 0x04, 0x00, 0xe0, 0x41, 0x70,
0x1c, 0x04, 0x00, 0xf0, 0x40, 0x70, 0x1c, 0x74, 0x00, 0x78, 0x4e, 0x70,
0x0e, 0x04, 0x00, 0x3c, 0x4a, 0xe0, 0x0e, 0x74, 0x03, 0x1e, 0x4a, 0xe0,
0x0e, 0x04, 0x00, 0x0f, 0x4e, 0xe0, 0x0e, 0x04, 0x80, 0x07, 0x40, 0xe0,
0x0e, 0x04, 0xf8, 0x0f, 0x40, 0xe0, 0x0e, 0x04, 0xe0, 0x01, 0x40, 0xe0,
0x0e, 0x04, 0xf8, 0x00, 0x40, 0xe0, 0x0e, 0x04, 0x78, 0x00, 0x40, 0xe0,
0x0e, 0x04, 0xfc, 0xf3, 0x40, 0xe0, 0x1c, 0x04, 0x1e, 0x00, 0x40, 0x70,
0x1c, 0x04, 0x0f, 0x00, 0x40, 0x70, 0x1c, 0x84, 0x07, 0x00, 0x40, 0x70,
0x3c, 0xfc, 0xff, 0xff, 0x7f, 0x78, 0x38, 0xe0, 0x01, 0x00, 0x00, 0x38,
0x38, 0xf0, 0x00, 0x00, 0x00, 0x38, 0x70, 0x78, 0x00, 0x00, 0x00, 0x1c,
0xf0, 0x3c, 0x00, 0x00, 0x00, 0x1e, 0xe0, 0x1e, 0x00, 0x00, 0x00, 0x0e,
0xe0, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x07, 0x00, 0x00, 0x80, 0x07,
0x80, 0x07, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x1f, 0x00, 0x00, 0xf0, 0x01,
0x00, 0x3e, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x7f, 0x00,
0x00, 0xf0, 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0xc0, 0xff, 0xff, 0x07, 0x00,
0x00, 0x00, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00};

View file

@ -1,6 +0,0 @@
#define foo_width 16
#define foo_height 16
static char foo_bits[] = {
0x60, 0x06, 0x90, 0x09, 0x90, 0x09, 0xb0, 0x0d, 0x4e, 0x72, 0x49, 0x92,
0x71, 0x8e, 0x8e, 0x71, 0x8e, 0x71, 0x71, 0x8e, 0x49, 0x92, 0x4e, 0x72,
0xb0, 0x0d, 0x90, 0x09, 0x90, 0x09, 0x60, 0x06};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

File diff suppressed because one or more lines are too long

View file

@ -26,7 +26,8 @@ TkLabel.new($items_demo) {
# frame 生成
TkFrame.new($items_demo) {|frame|
TkButton.new(frame) {
text 'λ²ò'
#text 'λ²ò'
text 'ÊĤ¸¤ë'
command proc{
tmppath = $items_demo
$items_demo = nil
@ -119,8 +120,8 @@ TkcLine.new(cvs, '5c','6c','9c','6c','9c','1c','8c','1c','8c','4.8c','8.8c',
'8.6c','1.4c','8.4c','1.4c','8.4c','4.4c',
'width'=>3, 'fill'=>red, 'tags'=>$tag_item )
TkcLine.new(cvs, '1c','5c','7c','5c','7c','7c','9c','7c', 'width'=>'.5c',
'stipple'=>'@'+[$demo_dir,
'images','gray25.bmp'].join(File::Separator),
'stipple'=>'@'+[$demo_dir,'..',
'images','gray25.xbm'].join(File::Separator),
'arrow'=>'both', 'arrowshape'=>'15 15 7', 'tags'=>$tag_item )
TkcLine.new(cvs, '1c','7c','1.75c','5.8c','2.5c','7c','3.25c','5.8c','4c','7c',
'width'=>'.5c', 'capstyle'=>'round', 'join'=>'round',
@ -135,8 +136,8 @@ TkcLine.new(cvs, '15.5c','1c','19.5c','1.5c','15.5c','4.5c','19.5c','4c',
TkcLine.new(cvs, '12c','6c','13.5c','4.5c','16.5c','7.5c','18c','6c',
'16.5c','4.5c','13.5c','7.5c','12c','6c',
'smooth'=>'on', 'width'=>'3m', 'capstyle'=>'round',
'stipple'=>'@'+[$demo_dir,
'images', 'gray25.bmp'].join(File::Separator),
'stipple'=>'@'+[$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator),
'fill'=>red, 'tags'=>$tag_item )
TkcText.new(cvs, '25c', '.2c', 'text'=>'多角形', 'anchor'=>'n')
@ -150,8 +151,8 @@ TkcPolygon.new(cvs, '25c','4c','25c','4c','25c','1c','26c','1c','27c','4c',
TkcPolygon.new(cvs, '22c','4.5c','25c','4.5c','25c','6.75c','28c','6.75c',
'28c','5.25c','24c','5.25c','24c','6.0c','26c','6c','26c',
'7.5c','22c','7.5c',
'stipple'=>'@' + [$demo_dir,
'images', 'gray25.bmp'].join(File::Separator),
'stipple'=>'@' + [$demo_dir, '..',
'images', 'gray25.xbm'].join(File::Separator),
'outline'=>'black', 'tags'=>$tag_item )
TkcText.new(cvs, '5c', '8.2c', 'text'=>'矩形', 'anchor'=>'n')
@ -160,8 +161,8 @@ TkcRectangle.new(cvs, '1c','9.5c','4c','12.5c',
TkcRectangle.new(cvs, '0.5c','13.5c','4.5c','15.5c',
'fill'=>green, 'tags'=>$tag_item )
TkcRectangle.new(cvs, '6c','10c','9c','15c', 'outline'=>'',
'stipple'=>'@'+[$demo_dir,
'images','gray25.bmp'].join(File::Separator),
'stipple'=>'@'+[$demo_dir,'..',
'images','gray25.xbm'].join(File::Separator),
'fill'=>blue, 'tags'=>$tag_item )
TkcText.new(cvs, '15c', '8.2c', 'text'=>'楕円', 'anchor'=>'n')
@ -170,8 +171,8 @@ TkcOval.new(cvs, '11c','9.5c','14c','12.5c',
TkcOval.new(cvs, '10.5c','13.5c','14.5c','15.5c',
'fill'=>green, 'tags'=>$tag_item )
TkcOval.new(cvs, '16c','10c','19c','15c', 'outline'=>'',
'stipple'=>'@'+[$demo_dir,
'images','gray25.bmp'].join(File::Separator),
'stipple'=>'@'+[$demo_dir,'..',
'images','gray25.xbm'].join(File::Separator),
'fill'=>blue, 'tags'=>$tag_item )
TkcText.new(cvs, '25c', '8.2c', 'text'=>'テキスト', 'anchor'=>'n')
@ -186,7 +187,7 @@ TkcText.new(cvs, '25.5c', '11c', 'anchor'=>'w', 'font'=>font1, 'fill'=>blue,
TkcRectangle.new(cvs, '24.9c','13.9c','25.1c','14.1c')
if $tk_version =~ /^4\.[01]/
TkcText.new(cvs, '25c', '14c', 'anchor'=>'c', 'font'=>font2, 'fill'=>red,
'stipple'=>'@' + [$demo_dir,
'stipple'=>'@' + [$demo_dir, '..',
'images', 'grey.5'].join(File::Separator),
'text'=>'Stippled characters', 'tags'=>$tag_item )
else
@ -204,8 +205,8 @@ TkcArc.new(cvs, '0.5c','17c','7c','20c', 'fill'=>green, 'outline'=>'black',
# 'tags'=>$tag_item)
TkcArc.new(cvs, '6.5c','17c','9.5c','20c', 'width'=>'4m', 'style'=>'arc',
'outline'=>blue, 'start'=>135, 'extent'=>270,
'outlinestipple'=>'@'+[$demo_dir,
'images','gray25.bmp'].join(File::Separator),
'outlinestipple'=>'@'+[$demo_dir, '..',
'images','gray25.xbm'].join(File::Separator),
'tags'=>$tag_item)
TkcArc.new(cvs, '0.5c','20c','9.5c','24c', 'width'=>'4m', 'style'=>'pieslice',
'fill'=>'', 'outline'=>red, 'start'=>225, 'extent'=>90,
@ -219,22 +220,22 @@ TkcText.new(cvs, '15c', '16.2c', 'text'=>'
# 'bitmap'=>'@' + ['images', 'face'].join(File::Separator),
# 'tags'=>$tag_item)
TkcBitmap.new(cvs, '13c','20c',
'bitmap'=>'@' + [$demo_dir,
'images', 'face.bmp'].join(File::Separator),
'bitmap'=>'@' + [$demo_dir, '..',
'images', 'face.xbm'].join(File::Separator),
'tags'=>$tag_item)
#TkcBitmap.new(cvs, '17c','18.5c',
# 'bitmap'=>'@' + ['images', 'noletters'].join(File::Separator),
# 'tags'=>$tag_item)
TkcBitmap.new(cvs, '17c','18.5c',
'bitmap'=>'@' + [$demo_dir,
'images', 'noletter.bmp'].join(File::Separator),
'bitmap'=>'@' + [$demo_dir, '..',
'images', 'noletter.xbm'].join(File::Separator),
'tags'=>$tag_item)
#TkcBitmap.new(cvs, '17c','21.5c',
# 'bitmap'=>'@' + ['images', 'letters'].join(File::Separator),
# 'tags'=>$tag_item)
# ↓の形式でも可能
TkcBitmap.new(cvs, '17c','21.5c') {
bitmap '@' + [$demo_dir, 'images', 'letters.bmp'].join(File::Separator)
bitmap '@' + [$demo_dir, '..', 'images', 'letters.xbm'].join(File::Separator)
tags $tag_item
}
#TkcBitmap.new(cvs, '17c','21.5c') {
@ -357,7 +358,7 @@ end
def itemDrag(c,x,y)
x = c.canvasx(x)
y = c.canvasy(y)
c.move 'current', x - $lastX, y - $lastY
c.move('current', x - $lastX, y - $lastY)
$lastX = x
$lastY = y
end

Some files were not shown because too many files have changed in this diff Show more