Hi, 

From: Ara.T.Howard / noaa.gov
Subject: tkscrollframe.rb
Date: Wed, 7 Jan 2004 10:36:42 +0900
Message-ID: <Pine.LNX.4.44.0401061700240.2595-100000 / fattire.ngdc.noaa.gov>
> # note that the parent of all widgets bound for scrollframe **MUST** be f
>   sf = TkScrollFrame.new r
>   f = sf.scrollframe

If you set @path instance variable, you don't need the access method 
for the frame widget. To decide the target widget name of method calls, 
@path variable is used. And geometry managers use @epath. 

--- tkscrollframe.rb.orig       2004-01-07 12:37:29.000000000 +0900
+++ tkscrollframe.rb    2004-01-07 12:38:16.000000000 +0900
@@ -21,6 +21,8 @@
     @f_frame = TkFrame.new @c_frame
     @w_frame = TkcWindow.new @c_frame, 0, 0, :window=>@f_frame, :anchor=>'nw'
 
+    @path = @f_frame.path
+
   # assign scrollbars
     @c_frame.xscrollbar(@h_scroll)
     @c_frame.yscrollbar(@v_scroll)
@@ -47,10 +49,6 @@
   def set_scrollregion w=@f_frame.winfo_reqwidth, h=@f_frame.winfo_reqheight
     @c_frame.scrollregion [0, 0, w, h] 
   end
-
-  # use these to get a handle on frame to put widgets in
-  attr :f_frame
-  alias scrollframe f_frame
 #}}}
 end
 
@@ -65,8 +63,7 @@
   r = TkRoot.new
 
 # note that the parent of all widgets bound for scrollframe **MUST** be f
-  sf = TkScrollFrame.new r
-  f = sf.scrollframe
+  f = TkScrollFrame.new r
 
 # set up first frame
   frame0 = TkFrame.new f
@@ -102,7 +99,7 @@
 
 # main 
   b.pack :expand=>true, :fill=>'x'
-  sf.pack :expand=>true, :fill=>'both'
+  f.pack :expand=>true, :fill=>'both'
   Tk.mainloop
 
 #}}}

-- 
                                  Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)