まつもと ゆきひろです

これもフォワード。

------- Start of forwarded message -------
Date: Fri, 7 Sep 2001 09:44:00 +0900
Posted: Thu, 6 Sep 2001 19:44:30 -0500
From: Albert Wagner <alwagner / tcac.net>
Subject: [ruby-talk:20964] Re: Is Ruby/Tk being maintained?
To: ruby-talk / ruby-lang.org (ruby-talk ML)
In-Reply-To: <999756887.047188.23474.nullmailer / ev.netlab.jp>

OK. Here's the rest of the info:  I'm running SuSe7.1 with the standard rpm 
Tcl/Tk 8.3.2-5 installed;  ruby1.6.4 compiled from tarball on gcc 2.95.2-149.
Attached is a sample.rb script that duplicates the problem with -rdebug.  
BTW, trying to run the tkDemo widget with -rdebug simply prints "Killed" 
after starting with the c debug command.

module SampleModule

require 'tk'

#==========================================================
class Sample

    def initialize(parent)
        
        # Define master frame to hold table and scrollbars        
        @bigGrid = TkFrame.new(parent)
        @bigGrid.pack(
            'expand' => 'yes',
            'fill'   => 'both',
            'padx'   => 1,
            'pady'   => 1
            )
        TkGrid.rowconfigure(@bigGrid, 0,
            'weight'  => 1,
            'minsize' => 0
            )
        TkGrid.columnconfigure(@bigGrid, 0,
            'weight'  => 1,
            'minsize' => 0
            )
            
        @courierItalicBold12   = '-*-Courier-Bold-O-Normal--*-120-*-*-*-*-*-*'
        @courier12             = '-*-Courier-*-R-Normal--*-120-*-*-*-*-*-*'        
        @courierBold14         = '-*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*'
        @helveticaBold24       = '-*-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*'
        @adobeHelveticaBold10  = '-Adobe-Helvetica-Bold-R-Normal-*-100-*'
        @adobeHelveticaBold10a = '-Adobe-Helvetica-Bold-R-Normal-*-100-*'
       
        # Define text widget
        @doc = TkText.new(parent,
            'relief'        => 'sunken',
            'bd'            => '2',
            'font'          => @courier12,
            'wrap'          => 'none'
            )
        @doc.grid(\
            'in'        => @bigGrid,
            'padx'      => 1,
            'pady'      => 1,
            'row'       => 0,
            'col'       => 0,
            'rowspan'   => 1,
            'columnspan'=> 1,
            'sticky'    => 'news'
           )
           
        20.times {|i|
            @doc.insert('end', "Sample text line #{i}\n")
        }

        # Define Vertical Scrollbar            
        @vbar = TkScrollbar.new(parent,
            'orient'  => 'vertical',
            'command' => proc{|*args|@doc.yview(*args)} 
            )
        @vbar.grid(\
            'in' => @bigGrid,
            'padx'      => 1,
            'pady'      => 1,
            'row'       => 0,
            'col'       => 1,
            'rowspan'   => 1,
            'columnspan'=> 1,
            'sticky'    => 'news'
            )
        @doc.yscrollcommand(proc{|first, last| @vbar.set first, last})
        
        # Define Horizontal Scrollbar            
        @hbar = TkScrollbar.new(parent, 
            'orient'  => 'horizontal',
            'command' => proc{|*args|@doc.xview(*args)}
            )
        @hbar.grid('in' => @bigGrid,
            'padx'      => 1,
            'pady'      => 1,
            'row'       => 1,
            'col'       => 0,
            'rowspan'   => 1,
            'columnspan'=> 1,
            'sticky'    => 'news'
            )
        @doc.xscrollcommand(proc{|first, last| @hbar.set first, last})
            

    end # initialization ================================
    

end # class Sample

end # module SampleModule
#=============================================================
#  Test
#=============================================================

root = TkRoot.new {title 'Sample Test'}
SampleModule::Sample.new(root)
Tk.mainloop
------- End of forwarded message -------