~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to ext/tk/README.fork

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Ruby/Tk does NOT support forking the process on which Tk interpreter
 
2
is running (unless NEVER control Tk interpreter under the forked child 
 
3
process). In the library 'tk.rb', a Tk interpreter is initialized. 
 
4
Therefore, if you want running Tk under a child process, please call
 
5
"require 'tk'" in the child process. 
 
6
 
 
7
# If do fork and exec(<new Ruby/Tk>) on the child process, you can 
 
8
# control Ruby/Tk interpreter on the child process by 'send' command 
 
9
# of Tcl/Tk. About this, please see Tk.appsend and Tk.rb_appsend, or 
 
10
# 'remote-tk.rb' and the sample 'sample/remote-ip_sample.rb'. 
 
11
 
 
12
For example, the following sample1 will NOT work, and sample2 will
 
13
work properly.
 
14
 
 
15
---<sample1: NOT work>---------------------------------------
 
16
require 'tk'  ## init Tk interpreter under parent process
 
17
 
 
18
exit! if fork ## exit parent process
 
19
 
 
20
## child process
 
21
TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack
 
22
Tk.mainloop
 
23
-------------------------------------------------------------
 
24
 
 
25
---<sample2: will work>--------------------------------------
 
26
exit! if fork ## exit main process
 
27
 
 
28
## child process
 
29
require 'tk'  ## init Tk interpreter under child process
 
30
TkButton.new(:text=>'QUIT', :command=>proc{exit}).pack
 
31
Tk.mainloop
 
32
-------------------------------------------------------------
 
33
 
 
34
                                         2004/05/22  Hidetoshi NAGAI