2003-10-17 03:59:32 -04:00
|
|
|
(tof)
|
2005-07-05 01:56:31 -04:00
|
|
|
2005/07/05 Hidetoshi NAGAI
|
2003-10-17 03:59:32 -04:00
|
|
|
|
|
|
|
This document discribes about the 'tcltklib' library. Although there
|
|
|
|
is the 'tcltk' library (tcltk.rb) under this directory, no description
|
2011-05-22 05:26:02 -04:00
|
|
|
in this document (because it is not maintained recently).
|
2003-10-17 03:59:32 -04:00
|
|
|
|
|
|
|
==============================================================
|
|
|
|
module TclTklib
|
2011-05-22 05:26:02 -04:00
|
|
|
: Defines methods to do operations which are independed on
|
2003-10-17 03:59:32 -04:00
|
|
|
: Tcl/Tk interpreters
|
|
|
|
|
|
|
|
module TclTkLib::EventFlag
|
2011-10-23 05:22:59 -04:00
|
|
|
: Defines flags to define target events on 'do_one_event' methods.
|
2011-05-22 05:26:02 -04:00
|
|
|
: When to give, please use bit-operator (e.g. WINDOW | DONT_WAIT).
|
2003-10-17 03:59:32 -04:00
|
|
|
|
|
|
|
[constants]
|
|
|
|
NONE
|
|
|
|
: Is 0. It means "there is no target". But on the real
|
|
|
|
: operation, it is same to ALL.
|
|
|
|
|
|
|
|
WINDOW
|
|
|
|
: 'window' event is processed.
|
|
|
|
|
|
|
|
FILE
|
|
|
|
: 'file' event is processed.
|
|
|
|
|
|
|
|
TIMER
|
|
|
|
: 'timer' event is processed.
|
|
|
|
|
|
|
|
IDLE
|
|
|
|
: 'idle' operation (e.g. 're-draw'; the operations when the
|
2011-05-22 05:26:02 -04:00
|
|
|
: other kinds of events doesn't occur) is processed.
|
2003-10-17 03:59:32 -04:00
|
|
|
|
|
|
|
ALL
|
2011-05-22 05:26:02 -04:00
|
|
|
: All kinds of events are processed.
|
|
|
|
: Same to 'WINDOW | FILE | TIMER | IDLE'.
|
2003-10-17 03:59:32 -04:00
|
|
|
|
|
|
|
DONT_WAIT
|
2013-03-13 06:50:21 -04:00
|
|
|
: Without this flag, 'do_one_event' waits the occurrence of
|
2011-05-22 05:26:02 -04:00
|
|
|
: a target event. With this flag, doesn't wait and returns
|
|
|
|
: false if there is no target event for processing.
|
2003-10-17 03:59:32 -04:00
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
module TclTkLib::VarAccessFlag
|
2011-05-22 05:26:02 -04:00
|
|
|
: Defines flags to give '_get_variable' and so on. When to give,
|
|
|
|
: please use bit-operator (e.g. GLOBAL_ONLY | LEAVE_ERR_MSG ).
|
2003-10-17 03:59:32 -04:00
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
[constants]
|
|
|
|
NONE
|
2011-05-22 05:26:02 -04:00
|
|
|
: Is 0. It means "set no flag".
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
GLOBAL_ONLY
|
|
|
|
: (site Tcl/Tk's man page)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Under normal circumstances the procedures look up
|
|
|
|
: variables as follows: If a procedure call is active
|
2004-05-01 12:09:54 -04:00
|
|
|
: 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 ***
|
2011-05-22 05:26:02 -04:00
|
|
|
: Tcl7.6 doesn't have namespaces. So NAMESPACE_ONLY
|
2004-05-01 12:09:54 -04:00
|
|
|
: is defined as 0, and then GLOBAL_ONLY is available
|
2011-05-22 05:26:02 -04:00
|
|
|
: even if flag is (GLOBAL_ONLY | NAMESPACE_ONLY).
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
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 ***
|
2011-05-22 05:26:02 -04:00
|
|
|
: Tcl7.6 doesn't have namespaces. So NAMESPACE_ONLY
|
2004-05-01 12:09:54 -04:00
|
|
|
: is defined as 0.
|
|
|
|
|
|
|
|
LEAVE_ERR_MSG
|
|
|
|
: (site Tcl/Tk's man page)
|
2011-05-22 05:26:02 -04:00
|
|
|
: If an error is returned and this bit is set in flags,
|
2004-05-01 12:09:54 -04:00
|
|
|
: then an error message will be left in the interpreter's
|
|
|
|
: result, where it can be retrieved with Tcl_GetObjResult
|
2011-05-22 05:26:02 -04:00
|
|
|
: or Tcl_GetStringResult. If this flag bit isn't set then
|
|
|
|
: no error message is left and the interpreter's result
|
2004-05-01 12:09:54 -04:00
|
|
|
: will not be modified.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
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
|
2011-05-22 05:26:02 -04:00
|
|
|
: to be the first element in a list or sublist (i.e. the
|
|
|
|
: variable's current value is empty, or contains the
|
2004-05-01 12:09:54 -04:00
|
|
|
: single character ``{'', or ends in `` }'').
|
|
|
|
|
|
|
|
PARSE_VARNAME
|
|
|
|
: (site Tcl/Tk's man page)
|
2011-05-22 05:26:02 -04:00
|
|
|
: If this bit is set when calling _set_variable and so
|
2004-05-01 12:09:54 -04:00
|
|
|
: on, var_name argument may contain both an array and an
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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
|
2004-05-01 12:09:54 -04:00
|
|
|
: (which can have any string value) and the characters
|
2011-05-22 05:26:02 -04:00
|
|
|
: before the first open parenthesis are treated as the
|
2004-05-01 12:09:54 -04:00
|
|
|
: name of an array variable. If the flag PARSE_VARNAME
|
2011-05-22 05:26:02 -04:00
|
|
|
: is given, index_name argument should be 'nil' since the
|
2004-05-01 12:09:54 -04:00
|
|
|
: array and element names are taken from var_name.
|
|
|
|
:
|
|
|
|
: *** ATTENTION ***
|
2011-05-22 05:26:02 -04:00
|
|
|
: Tcl7.6 doesn't have this flag. So PARSE_VARNAME is
|
|
|
|
: defined as 0.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
2007-12-21 03:57:35 -05:00
|
|
|
module TclTkLib::RELEASE_TYPE
|
|
|
|
: Defines release type number of Tcl/Tk
|
|
|
|
|
|
|
|
ALPHA
|
|
|
|
: ALPHA release
|
|
|
|
|
|
|
|
BETA
|
|
|
|
: BETA release
|
|
|
|
|
|
|
|
FINAL
|
|
|
|
: FINAL release
|
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
[module methods]
|
2007-12-21 03:57:35 -05:00
|
|
|
get_version()
|
2011-05-22 05:26:02 -04:00
|
|
|
: return an array of major, minor, release-type number,
|
2009-07-12 19:08:32 -04:00
|
|
|
: and patchlevel of current Tcl/Tk library.
|
2007-12-21 03:57:35 -05:00
|
|
|
|
2005-07-05 01:56:31 -04:00
|
|
|
mainloop(check_root = true)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Starts the eventloop. If 'check_root' is true, this method
|
|
|
|
: doesn't return when a root widget exists.
|
2013-03-13 06:50:21 -04:00
|
|
|
: If 'check_root' is false, doesn't return by the other
|
2004-05-01 12:09:54 -04:00
|
|
|
: reasons than exceptions.
|
|
|
|
|
2005-03-02 02:06:52 -05:00
|
|
|
mainloop_thread?
|
2011-05-22 05:26:02 -04:00
|
|
|
: Returns whether the current thread executes the eventloop.
|
|
|
|
: If true, the eventloop is working on the current thread.
|
2005-03-02 02:06:52 -05:00
|
|
|
: If no eventloop is working, this method returns nil.
|
|
|
|
: And if the other thread executes the eventloop, returns false.
|
2011-05-22 05:26:02 -04:00
|
|
|
:
|
2005-03-02 02:06:52 -05:00
|
|
|
: *** ATTENTION ***
|
2011-05-22 05:26:02 -04:00
|
|
|
: When this methods returns false, it is dangerous to call a Tk
|
2005-03-02 02:06:52 -05:00
|
|
|
: interpreter directly.
|
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
mainloop_watchdog(check_root = true)
|
2011-05-22 05:26:02 -04:00
|
|
|
: On the normal eventloop, some kinds of callback operations
|
2004-05-01 12:09:54 -04:00
|
|
|
: cause deadlock. To avoid some of such deadlocks, this
|
|
|
|
: method starts an eventloop and a watchdog-thread.
|
|
|
|
|
2011-05-22 05:26:02 -04:00
|
|
|
do_one_event(flag = TclTkLib::EventFlag::ALL |
|
2004-05-01 12:09:54 -04:00
|
|
|
TclTkLib::EventFlag::DONT_WAIT)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Do one event for processing. When processed an event,
|
|
|
|
: returns true.
|
2004-05-01 12:09:54 -04:00
|
|
|
: If NOT set DONT_WAIT flag, this method waits occurrence of
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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,
|
2004-05-01 12:09:54 -04:00
|
|
|
: force to set DONT_WAIT flag.
|
|
|
|
|
|
|
|
set_eventloop_tick(timer_tick)
|
|
|
|
: Define the interval of thread-switching with an integer
|
2011-05-22 05:26:02 -04:00
|
|
|
: value of mili-seconds.
|
|
|
|
: Default timer_tick is 0. It means that thread-switching
|
|
|
|
: is based on the count of processed events.
|
2004-05-01 12:09:54 -04:00
|
|
|
: ( see 'set_eventloop_weight' method )
|
2011-05-22 05:26:02 -04:00
|
|
|
: However, if the eventloop thread is the only thread,
|
2013-03-13 06:50:21 -04:00
|
|
|
: timer_tick cannot be set to 0. If 0, then is set to 100 ms
|
2011-05-22 05:26:02 -04:00
|
|
|
: automatically (see NO_THREAD_INTERRUPT_TIME on tcltklib.c).
|
|
|
|
: On $SAFE >= 4, cannot call this method.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
get_eventloop_tick
|
|
|
|
: Get current value of 'timer_tick'
|
|
|
|
|
|
|
|
set_no_event_wait(no_event_wait)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Define sleeping time of the eventloop when two or more
|
|
|
|
: thread are running and there is no event for processing.
|
2004-05-01 12:09:54 -04:00
|
|
|
: Default value is 20 (ms).
|
2011-05-22 05:26:02 -04:00
|
|
|
: If the eventloop thread is the only thread, this value is
|
|
|
|
: invalid.
|
|
|
|
: On $SAFE >= 4, cannot call this method.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
get_no_event_wait
|
|
|
|
: Get current value of 'no_event_wait'.
|
|
|
|
|
|
|
|
set_eventloop_weight(loop_max, no_event_tick)
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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
|
2013-03-13 06:50:21 -04:00
|
|
|
: when no event for processing (And then, the eventloop thread
|
2011-05-22 05:26:02 -04:00
|
|
|
: sleeps 'no_event_wait' mili-seconds).
|
2013-03-13 06:50:21 -04:00
|
|
|
: 'loop_max == 800' and 'no_event_tick == 10' are default.
|
2011-05-22 05:26:02 -04:00
|
|
|
: On $SAFE >= 4, cannot call this method.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
get_eventloop_weight
|
|
|
|
: Get current values of 'loop_max' and 'no_event_tick'.
|
|
|
|
|
|
|
|
mainloop_abort_on_exception=(bool)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Define whether the eventloop stops on exception or not.
|
|
|
|
: If true (default value), stops on exception.
|
2013-03-13 06:50:21 -04:00
|
|
|
: If false, show a waring message but ignore the exception.
|
|
|
|
: If nil, no warning message and ignore the exception.
|
2004-05-01 12:09:54 -04:00
|
|
|
: This parameter is sometimes useful when multiple Tk
|
2011-05-22 05:26:02 -04:00
|
|
|
: interpreters are working. Because the only one eventloop
|
2004-05-01 12:09:54 -04:00
|
|
|
: admins all Tk interpreters, sometimes exception on a
|
|
|
|
: interpreter kills the eventloop thread. Even if such
|
2011-05-22 05:26:02 -04:00
|
|
|
: situation, when abort_on_exception == false or nil,
|
|
|
|
: the eventloop ignores the exception and continue to working.
|
|
|
|
: On $SAFE >= 4, cannot call this method.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
mainloop_abort_on_exception
|
2011-05-22 05:26:02 -04:00
|
|
|
: Get current status of that.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
num_of_mainwindows
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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
|
2004-05-01 12:09:54 -04:00
|
|
|
: available Tk functions.
|
|
|
|
|
|
|
|
_merge_tklist(str, str, ... )
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
_conv_listelement(str)
|
|
|
|
: Convert the argument to a valid Tcl list element with
|
|
|
|
: Tcl/Tk's library function.
|
|
|
|
|
2005-07-05 01:56:31 -04:00
|
|
|
_toUTF8(str, encoding=nil)
|
|
|
|
_fromUTF8(str, encoding=nil)
|
2004-05-01 12:09:54 -04:00
|
|
|
: 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).
|
2011-05-22 05:26:02 -04:00
|
|
|
: _subst_Tcl_backslash method parses all backslash sequence.
|
2004-05-01 12:09:54 -04:00
|
|
|
: _subst_UTF_backslash method parses \uhhhh only.
|
2003-10-17 03:59:32 -04:00
|
|
|
|
2005-07-05 01:56:31 -04:00
|
|
|
encoding_system
|
|
|
|
encoding_system=(encoding)
|
|
|
|
: Get and set Tcl's system encoding.
|
|
|
|
|
|
|
|
encoding
|
|
|
|
encoding=(encoding)
|
|
|
|
: alias of encoding_system / encoding_system=
|
|
|
|
: ( probably, Ruby/Tk's tk.rb will override them )
|
|
|
|
|
|
|
|
|
2003-10-17 03:59:32 -04:00
|
|
|
class TclTkIp
|
|
|
|
[class methods]
|
2004-05-01 12:09:54 -04:00
|
|
|
new(ip_name=nil, options='')
|
2011-05-22 05:26:02 -04:00
|
|
|
: Generate an instance of TclTkIp class.
|
2004-05-01 12:09:54 -04:00
|
|
|
: If 'ip_name' argument is given as a string, it is the name
|
|
|
|
: of the Tk interpreter which is shown by 'winfo interps'
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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.
|
2004-05-01 12:09:54 -04:00
|
|
|
: ( e.g. TclTkIp.new('FOO', '-geometry 500x200 -use 0x2200009') )
|
2013-03-13 06:50:21 -04:00
|
|
|
: If is given nil or false for the 'option' argument, generates
|
2011-05-22 05:26:02 -04:00
|
|
|
: the Tcl interpreter without Tk library. Then the interpreter
|
2004-05-01 12:09:54 -04:00
|
|
|
: doesn't need GUI environment. Therefore, even if a window
|
|
|
|
: system doesn't exist or cannot be used, Ruby can control the
|
2013-03-13 06:50:21 -04:00
|
|
|
: Tcl interpreter and the extension libraries loaded on the
|
2011-05-22 05:26:02 -04:00
|
|
|
: interpreter.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
[instance methods]
|
|
|
|
create_slave(name, safe=false)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Create a slave interpreter.
|
2004-05-01 12:09:54 -04:00
|
|
|
: The parent of the interpreter is the receiver of this method.
|
2011-05-22 05:26:02 -04:00
|
|
|
: The name of the slave interpreter is given by 'name' argument.
|
2004-05-01 12:09:54 -04:00
|
|
|
: 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
|
2011-05-22 05:26:02 -04:00
|
|
|
: a safe interpreter (ignore 'safe' argument value).
|
|
|
|
: If $SAFE >= 4, can create a safe interpreter only.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
make_safe
|
|
|
|
: Make the interpreter to the safe interpreter, and returns
|
|
|
|
: self. If fail, raise RuntimeError.
|
|
|
|
|
|
|
|
safe?
|
2011-05-22 05:26:02 -04:00
|
|
|
: Check whether the interpreter is the safe interpreter.
|
|
|
|
: If is the safe interpreter, returns true.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
2004-09-11 13:45:53 -04:00
|
|
|
allow_ruby_exit?
|
2011-05-22 05:26:02 -04:00
|
|
|
: Return the mode whether 'exit' function of ruby or 'exit'
|
|
|
|
: command of Tcl/Tk can quit the ruby process or not on the
|
|
|
|
: interpreter. If false, such a command quit the interpreter
|
2004-09-11 13:45:53 -04:00
|
|
|
: only.
|
2011-05-22 05:26:02 -04:00
|
|
|
: The default value for a master interpreter is true, and
|
2004-09-11 13:45:53 -04:00
|
|
|
: for a slave interpreter is false.
|
|
|
|
|
|
|
|
allow_ruby_exit=(mode)
|
|
|
|
: Change the mode of 'allow_ruby_exit?'.
|
2011-05-22 05:26:02 -04:00
|
|
|
: If $SAFE >= 4 or the interpreter is a "safe" interpreter,
|
|
|
|
: this is not permitted (raise an exception).
|
2004-09-11 13:45:53 -04:00
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
delete
|
2011-05-22 05:26:02 -04:00
|
|
|
: Delete the interpreter.
|
2004-05-01 12:09:54 -04:00
|
|
|
: The deleted interpreter doesn't accept command and then
|
|
|
|
: raise an exception.
|
|
|
|
|
|
|
|
deleted?
|
|
|
|
: Check whether the interpreter is already deleted.
|
2011-05-22 05:26:02 -04:00
|
|
|
: If deleted, returns true.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
2005-07-21 18:05:04 -04:00
|
|
|
has_mainwindow?
|
|
|
|
: Check whether the interpreter has a MainWindow (root widget).
|
2011-05-22 05:26:02 -04:00
|
|
|
: If has, returns true. If doesn't, returns false.
|
|
|
|
: If IP is already deleted, returns nil.
|
2005-07-21 18:05:04 -04:00
|
|
|
|
2004-05-01 12:09:54 -04:00
|
|
|
restart
|
2011-05-22 05:26:02 -04:00
|
|
|
: Restart Tk part of the interpreter.
|
2004-05-01 12:09:54 -04:00
|
|
|
: Use this when you need Tk functions after destroying the
|
2011-05-22 05:26:02 -04:00
|
|
|
: root widget.
|
|
|
|
: On $SAFE >= 4, cannot call this method.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
_eval(str)
|
|
|
|
_invoke(*args)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Estimates the arguments as a command on the Tk interpreter.
|
2004-05-01 12:09:54 -04:00
|
|
|
: The argument of _eval is a script of Tcl/Tk.
|
|
|
|
: Each argument of _invoke is a token of one command line of
|
2011-05-22 05:26:02 -04:00
|
|
|
: Tcl/Tk.
|
2004-05-01 12:09:54 -04:00
|
|
|
: 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
|
2011-05-22 05:26:02 -04:00
|
|
|
: mechanism of the Tk interpreter doesn't work on _invoke.
|
2004-05-01 12:09:54 -04:00
|
|
|
: So _invoke can call only the command which already
|
2011-05-22 05:26:02 -04:00
|
|
|
: registered on the interpreter by 'load' command and so on.
|
|
|
|
: On _eval command, auto_load mechanism words. So if succeed
|
2013-03-13 06:50:21 -04:00
|
|
|
: to _eval and register the command once, after that, the
|
2011-05-22 05:26:02 -04:00
|
|
|
: command can be called by _invoke.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
2009-07-12 19:08:32 -04:00
|
|
|
_cancel_eval(str)
|
|
|
|
_cancel_eval_unwind(str)
|
|
|
|
: (Tcl/Tk8.6 or later)
|
|
|
|
: Call Tcl_CancelEval() function, and cancel evaluation.
|
|
|
|
|
2005-07-05 01:56:31 -04:00
|
|
|
_toUTF8(str, encoding=nil)
|
|
|
|
_fromUTF8(str, encoding=nil)
|
2004-05-01 12:09:54 -04:00
|
|
|
: 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)
|
2011-05-22 05:26:02 -04:00
|
|
|
: 'vwait' or 'tkwait' with thread support.
|
|
|
|
: The difference from normal 'vwait' or 'tkwait' command is
|
2004-05-01 12:09:54 -04:00
|
|
|
: 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 /
|
2011-05-22 05:26:02 -04:00
|
|
|
: tkwait is called on waiting for 1st vwait / tkwait,
|
2004-05-01 12:09:54 -04:00
|
|
|
: returns the order of [2nd]->[1st] regardless of the order
|
2011-05-22 05:26:02 -04:00
|
|
|
: of when the wait condition was fulfilled.
|
2004-05-01 12:09:54 -04:00
|
|
|
: 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
|
2011-05-22 05:26:02 -04:00
|
|
|
: eventloop, stops the thread. And when the wait condition
|
2004-05-01 12:09:54 -04:00
|
|
|
: is fulfilled, the thread restarts. The meaning of
|
2011-05-22 05:26:02 -04:00
|
|
|
: "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,
|
2004-05-01 12:09:54 -04:00
|
|
|
: _thread_vwait completes the waiting when its waiting
|
|
|
|
: condition is fulfilled and the thread which stopped by
|
2011-05-22 05:26:02 -04:00
|
|
|
: _thread_vwait can continue the operation.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
_return_value
|
2011-05-22 05:26:02 -04:00
|
|
|
: Get the last result value on the interpreter.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
_get_variable(var_name, flag)
|
|
|
|
_get_variable2(var_name, index_name, flag)
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
_set_variable(var_name, value, flag)
|
|
|
|
_set_variable2(var_name, index_name, value, flag)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Create or modify a variable. If specified a index_name
|
|
|
|
: (see also the PARSE_VARNAME flag), create or modify the
|
|
|
|
: index_name element.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
_unset_variable(var_name)
|
|
|
|
_unset_variable2(var_name, index_name)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Remove a variable. If specified a index_name (see also
|
|
|
|
: the PARSE_VARNAME flag), remove the index_name element.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
_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)
|
2011-05-22 05:26:02 -04:00
|
|
|
: Split the argument with Tcl/Tk's library function and
|
2004-05-01 12:09:54 -04:00
|
|
|
: get an array as a list of Tcl list elements.
|
|
|
|
|
|
|
|
_merge_tklist(str, str, ... )
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
_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
|
2011-05-22 05:26:02 -04:00
|
|
|
: returns nil.
|
2004-05-01 12:09:54 -04:00
|
|
|
: With the exception that, same to the TclTkLib module method
|
2011-05-22 05:26:02 -04:00
|
|
|
: with the same name.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
do_one_event
|
|
|
|
: With the exception that the argument is forced to set
|
|
|
|
: DONT_WAIT flag on the slave interpreter, same to
|
2011-05-22 05:26:02 -04:00
|
|
|
: TclTkLib#do_one_event.
|
2004-05-01 12:09:54 -04:00
|
|
|
|
|
|
|
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
|
2011-05-22 05:26:02 -04:00
|
|
|
: the same name.
|
2003-10-17 03:59:32 -04:00
|
|
|
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 01:25:12 -04:00
|
|
|
encoding_table
|
2011-05-22 05:26:02 -04:00
|
|
|
: For Ruby m17n. Return encoding relation table between Ruby's
|
* ext/tk/*: full update Ruby/Tk to support Ruby(1.9|1.8) and Tc/Tk8.5.
* ext/tk/lib/tkextlib/tile.rb: [incompatible] remove TileWidgets'
instate/state/identify method to avoid the conflict with standard
widget options. Those methods are renamed to ttk_instate/ttk_state/
ttk_identify (tile_instate/tile_state/tile_identify are available
too). Although I don't recommend, if you realy need old methods,
please define "Tk::USE_OBSOLETE_TILE_STATE_METHOD = true" before
"require 'tkextlib/tile'".
* ext/tk/lib/tkextlib/tile.rb: "Tk::Tile::__Import_Tile_Widgets__!"
is obsolete. It outputs warning. To control default widget set,
use "Tk.default_widget_set = :Ttk".
* ext/tk/lib/tk.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__ method and
__set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method are defind
as module methods of TkConfigMethod. It may help users to wrap old
Ruby/Tk scripts (use standard widgets) to force to use Ttk widgets.
Ttk widgets don't have some options of standard widgets which are
control the view of widgets. When set ignore-mode true, configure
method tries to ignoure such unknown options with no exception.
Of course, it may raise other troubles on the GUI design.
So, those are a little danger methods.
* ext/tk/lib/tk/itemconfig.rb: __IGNORE_UNKNOWN_CONFIGURE_OPTION__
method and __set_IGNORE_UNKNOWN_CONFIGURE_OPTION__!(mode) method
are defind as module methods of TkItemConfigMethod as the same
purpose as TkConfigMethod's ones.
* ext/tk/sample/ttk_wrapper.rb: A new example. This is a tool for
wrapping old Ruby/Tk scripts (which use standard widgets) to use
Ttk (Tile) widgets as default.
* ext/tk/sample/tkextlib/tile/demo.rb: use ttk_instate/ttk_state
method instead of instate/state method.
* ext/tk/lib/tk/root, ext/tk/lib/tk/namespace.rb,
ext/tk/lib/tk/text.rb, ext/tk/lib/tkextlib/*: some 'instance_eval's
are replaced to "instance_exec(self)".
* ext/tk/lib/tk/event.rb: bug fix on KEY_TBL and PROC_TBL (?x is not
a character code on Ruby1.9).
* ext/tk/lib/tk/variable.rb: support new style of operation argument
on Tcl/Tk's 'trace' command for variables.
* ext/tk/sample/demos-jp/widget, ext/tk/sample/demos-en/widget: bug fix
* ext/tk/sammple/demos-jp/textpeer.rb,
ext/tk/sammple/demos-en/textpeer.rb: new widget demo.
* ext/tk/tcltklib.c: decrase SEGV troubles (probably)
* ext/tk/lib/tk.rb: remove Thread.critical access if Ruby1.9
* ext/tk/lib/tk/multi-tk.rb: support Ruby1.9 (probably)
* ext/tk/lib/tkextlib/tile.rb: add method to define Tcl/Tk command
to make Tcl/Tk theme sources (based on different version of Tile
extension) available.
(Tk::Tile::__define_LoadImages_proc_for_comaptibility__)
* ext/tk/lib/tk.rb, ext/tk/lib/tk/wm.rb: support dockable frames
(Tcl/Tk8.5 feature). 'wm' command can treat many kinds of widgets
as toplevel widgets.
* ext/tk/lib/tkextlib/tile/style.rb: ditto.
(Tk::Tile::Style.__define_wrapper_proc_for_compatibility__)
* ext/tk/lib/tk/font.rb: add actual_hash and metrics_hash to get
properties as a hash. metrics_hash method returns a boolean value
for 'fixed' option. But metrics method returns numeric value
(0 or 1) for 'fixed' option, because of backward compatibility.
* ext/tk/lib/tk/timer.rb: somtimes fail to set callback procedure.
* ext/tk/lib/tk.rb: add Tk.sleep and Tk.wakeup method. Tk.sleep
doesn't block the eventloop. It will be better to use the method
in event callbacks.
* ext/tk/sample/tksleep_sample.rb: sample script about Tk.sleep.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-29 01:25:12 -04:00
|
|
|
: Encoding object and Tcl's encoding name.
|
|
|
|
|
2003-10-17 03:59:32 -04:00
|
|
|
class TkCallbackBreak < StandardError
|
|
|
|
class TkCallbackContinue < StandardError
|
2011-05-22 05:26:02 -04:00
|
|
|
: 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).
|
2004-05-01 12:09:54 -04:00
|
|
|
: If raise TkCallbackContinue, returns 'continue' code (Then the Tk
|
2013-03-13 06:50:21 -04:00
|
|
|
: interpreter will break the operation for the current bindtag and
|
|
|
|
: starts the operation for the next bindtag for the current event).
|
2011-05-22 05:26:02 -04:00
|
|
|
: However, current tcltklib supports Ruby's 'break' and 'next' to
|
|
|
|
: get the same effect. That is, those classes are obsolete. Those
|
|
|
|
: exist for backward compatibility.
|
2003-10-17 03:59:32 -04:00
|
|
|
|
|
|
|
(eof)
|