зеркало из https://github.com/github/ruby.git
* ext/tcltklib/tcltklib.c (ip_init): change flag value for setting 'argv' and 'argv0' variable
* ext/tk/lib/remote-tk.rb: follow changes of multi-tk.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a8fc3fb8b0
Коммит
d782aad77d
|
@ -1,3 +1,10 @@
|
|||
Thu Sep 9 13:58:56 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* ext/tcltklib/tcltklib.c (ip_init): change flag value for setting
|
||||
'argv' and 'argv0' variable
|
||||
|
||||
* ext/tk/lib/remote-tk.rb: follow changes of multi-tk.rb
|
||||
|
||||
Thu Sep 9 11:46:18 2004 Dave Thomas <dave@pragprog.com>
|
||||
|
||||
* lib/rdoc/parsers/parse_c.rb (RDoc::C_Parser::do_classes): Allow
|
||||
|
|
|
@ -2884,12 +2884,14 @@ ip_init(argc, argv, self)
|
|||
/* without Tk */
|
||||
with_tk = 0;
|
||||
} else {
|
||||
Tcl_SetVar(ptr->ip, "argv", StringValuePtr(opts), 0);
|
||||
/* Tcl_SetVar(ptr->ip, "argv", StringValuePtr(opts), 0); */
|
||||
Tcl_SetVar(ptr->ip, "argv", StringValuePtr(opts), TCL_GLOBAL_ONLY);
|
||||
}
|
||||
case 1:
|
||||
/* argv0 */
|
||||
if (!NIL_P(argv0)) {
|
||||
Tcl_SetVar(ptr->ip, "argv0", StringValuePtr(argv0), 0);
|
||||
/* Tcl_SetVar(ptr->ip, "argv0", StringValuePtr(argv0), 0); */
|
||||
Tcl_SetVar(ptr->ip, "argv0", StringValuePtr(argv0), TCL_GLOBAL_ONLY);
|
||||
}
|
||||
case 0:
|
||||
/* no args */
|
||||
|
@ -2917,6 +2919,7 @@ ip_init(argc, argv, self)
|
|||
|
||||
/* get main window */
|
||||
mainWin = Tk_MainWindow(ptr->ip);
|
||||
Tk_Preserve((ClientData)mainWin);
|
||||
|
||||
/* add ruby command to the interpreter */
|
||||
#if TCL_MAJOR_VERSION >= 8
|
||||
|
@ -3015,6 +3018,8 @@ ip_init(argc, argv, self)
|
|||
(ClientData)mainWin, (Tcl_CmdDeleteProc *)NULL);
|
||||
#endif
|
||||
|
||||
Tk_Release((ClientData)mainWin);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,17 @@ class MultiTkIp
|
|||
@@TK_TABLE_LIST = [].taint unless defined?(@@TK_TABLE_LIST)
|
||||
def self._IP_TABLE; @@IP_TABLE; end
|
||||
def self._TK_TABLE_LIST; @@TK_TABLE_LIST; end
|
||||
|
||||
@flag = true
|
||||
def self._DEFAULT_MASTER
|
||||
# work only once
|
||||
if @flag
|
||||
@flag = nil
|
||||
@@DEFAULT_MASTER
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
class RemoteTkIp
|
||||
@@IP_TABLE = MultiTkIp._IP_TABLE unless defined?(@@IP_TABLE)
|
||||
|
@ -26,6 +37,15 @@ end
|
|||
|
||||
require 'multi-tk'
|
||||
|
||||
class RemoteTkIp
|
||||
if defined?(@@DEFAULT_MASTER)
|
||||
MultiTkIp._DEFAULT_MASTER
|
||||
else
|
||||
@@DEFAULT_MASTER = MultiTkIp._DEFAULT_MASTER
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
###############################
|
||||
|
||||
class << RemoteTkIp
|
||||
|
@ -73,14 +93,19 @@ class RemoteTkIp
|
|||
|
||||
@threadgroup = ThreadGroup.new
|
||||
|
||||
@safe_level = [$SAFE]
|
||||
|
||||
@cmd_queue = Queue.new
|
||||
|
||||
=begin
|
||||
@cmd_receiver, @receiver_watchdog = _create_receiver_and_watchdog()
|
||||
|
||||
@threadgroup.add @cmd_receiver
|
||||
@threadgroup.add @receiver_watchdog
|
||||
|
||||
@threadgroup.enclose
|
||||
=end
|
||||
@@DEFAULT_MASTER.assign_receiver_and_watchdog(self)
|
||||
|
||||
@@IP_TABLE[@threadgroup] = self
|
||||
@@TK_TABLE_LIST.size.times{
|
||||
|
@ -94,6 +119,10 @@ class RemoteTkIp
|
|||
end
|
||||
@ip_id = _create_connection
|
||||
|
||||
class << self
|
||||
undef :instance_eval
|
||||
end
|
||||
|
||||
self.freeze # defend against modification
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче