1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext
nagai 4cb164ee2a * tkfont.rb: Fix bugs on TkFont.init_widget_font for Tk8.x.
* tkafter.rb: Add self to 1st argument of interval- and loop-proc
    TkAfter#current_interval returns an interval (sleep) time value
    TkAfter#current_args returns an array of arguments
    TkAfter#return_value returns a return value of last loop-proc
      e.g.
         TkAfter.new(
           proc{|obj| 500 - obj.current_interval}, 10,
           [proc{|obj| p obj.current_args}, 'proc', 1],
           proc{|obj| p obj.current_args; ['return', 2]},
           [proc{|obj|
              p obj.return_value
              p ['proc', obj.current_args[0].call(obj.return_value[1],
                                                  obj.current_args[1])]},
            proc{|*args| args[0] + args[1]}, 1],
           proc{p ['proc', 4]} ).start(100)

* tk*.rb: Allow to use Symbols for parameters.
    Allow new notation of constructor (also allow old notation).
      e.g.
        TkFrame.new('classname'=>'User'){|base|
          pack
          f = TkFrame.new(base, :classname=>'ButtonFrame').pack
          TkButton.new(
             :parent     => f,
             :text       => 'Quit',
             :command    => proc{exit}
          ).pack(
             :fill => :x,
             :pady => 2
          )
        }

* tkcanvas.rb: (TkcItem) Add 'coords' parameter to the canvas item
    constructor (for new notation of constructor).
      e.g.
        c = TkCanvas.new.pack
        l = TkcLine.new(c, :coords=>[[0,0], [100,100]])

* tcltklib.c: New 'mainloop' and 'mainloop_watchdog'.
    The priority of their event-loop can be controlled.
    They accept an optional argument.
    If it false, they don't exit although the root widget is destroyed.
    This function is sometimes useful, if it is used with 'restart'.
    'mainloop' can't treat Thread#join/value in a callback routine.
    (e.g. TkButton.new(:command=>proc{p Thread.new{button.invoke}.value}) )
    'mainloop_watchdog' can treat them, but watchdog thread is always running
    (so, a little heavier than 'mainloop').
    If the purpose of using Thread#join/value is to do something under some
    safe-level, please use Proc object.
    (e.g. :command=>proc{$SAFE=1;proc{$SAFE=2;button.invoke}.call;p $SAFE})

* tk.rb: Support functions of new 'mainloop' and 'mainloop_watchdog'.

* tk.rb: (Tk.restart) Add 'app-name' paramater and 'use' parameter.
    'app-name' specifies the name and the resource class of the
    application. If 'app-name' is specified to 'xxx', the application
    class on the resource database is set to 'Xxx' and the application
    name is changed by the same rule of Tk.appname method.  'use'
    specifies the main window for embedding the root widget instead of
    generating a new window.

* tk.rb: Add new parameter 'widgetname' to the widget constructor to
    support effective use of Resource Database.  For example, the
    resource 'Xxx*quit.text: QUIT' can set the text of the button
    generated by the following code.
      e.g.
        Tk.restart('Xxx')
        TkButton.new(nil, 'widgetname'=>'quit', 'command'=>proc{exit}).pack
        Tk.mainloop

* tk.rb: TkOption::get always returns a tainted string.
    Add TkOption::new_proc_class.
    It generates a class to import procedures defined on the resource
    database. For example, there is a following resource file.
      ----< resource-test >------------
      *CMD.foo: {|*args| p [$SAFE, :foo, args]}
      *CMD.XXX.bar: {|*args| p [$SAFE, :bar, args]}
      *Button.command: ruby {p self; p $SAFE; TkOption::CMD::XXX.bar(1,2,3)}
      ---------------------------------
    The following code is a sample of use of the resource file.
      e.g.
        require 'tk'
        TkOption.readfile 'resource-test'
        p TkOption.new_proc_class(:CMD, [:foo], 1)
        p TkOption.new_proc_class(:XXX, [:bar], 2, false, TkOption::CMD)
        TkButton.new(:text=>'test').pack
        Tk.mainloop


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-06-04 07:03:33 +00:00
..
curses Make cvs ignore mkmf.log. 2002-03-04 04:11:22 +00:00
dbm Make cvs ignore mkmf.log. 2002-03-04 04:11:22 +00:00
digest Probably */depend should be added to this file too. 2002-03-21 20:11:49 +00:00
dl Get rid of a function. 2002-05-20 15:50:28 +00:00
etc * parse.y: yyparse #defines moved from intern.h 2002-05-29 05:20:39 +00:00
fcntl Make cvs ignore mkmf.log. 2002-03-04 04:11:22 +00:00
gdbm Make cvs ignore mkmf.log. 2002-03-04 04:11:22 +00:00
iconv * re.c (rb_reg_s_quote): # also should be quoted. 2002-05-07 08:32:01 +00:00
nkf Make cvs ignore mkmf.log. 2002-03-04 04:11:22 +00:00
pty Make cvs ignore mkmf.log. 2002-03-04 04:11:22 +00:00
racc/cparse copied from ext/etc. 2002-04-18 06:13:43 +00:00
readline Make cvs ignore mkmf.log. 2002-03-04 04:11:22 +00:00
sdbm * ext/sdbm/init.c (each_pair): moved prototype before the 2002-04-01 07:58:09 +00:00
socket * ext/socket/getaddrinfo.c (gai_strerror): make literals const. 2002-06-03 16:02:16 +00:00
stringio * ext/stringio/stringio.c (strio_mark): must check if ptr is NULL 2002-04-23 16:22:25 +00:00
strscan copied from ext/etc. 2002-04-18 06:13:43 +00:00
syslog * ext/digest: add depend file. 2002-03-18 09:24:39 +00:00
tcltklib * tkfont.rb: Fix bugs on TkFont.init_widget_font for Tk8.x. 2002-06-04 07:03:33 +00:00
tk * tkfont.rb: Fix bugs on TkFont.init_widget_font for Tk8.x. 2002-06-04 07:03:33 +00:00
Win32API Add. 2002-01-07 06:58:54 +00:00
win32ole change PLATFORM with RUBY_PLATFORM. 2002-06-03 11:44:08 +00:00
.cvsignore * ext/extmk.rb.in: support multi-level ext/ directories. 2001-07-13 18:02:10 +00:00
aix_mksym.rb remove marshal/gtk/kconv 1999-08-13 05:37:52 +00:00
configsub.rb * ext/configsub.rb: latest autoconf style support. 2002-03-20 16:04:08 +00:00
extmk.rb.in * ext/extmk.rb.in, lib/mkmf.rb: use 'do...end' instead of '{}' for Borland make. 2002-05-02 09:31:29 +00:00
Setup merge win32ole from rough 2002-06-01 12:34:30 +00:00
Setup.dj merge win32ole from rough 2002-06-01 12:34:30 +00:00
Setup.emx merge win32ole from rough 2002-06-01 12:34:30 +00:00
Setup.nt merge win32ole from rough 2002-06-01 12:34:30 +00:00
Setup.x68 merge win32ole from rough 2002-06-01 12:34:30 +00:00