[ruby-talk:00350] Bugs in the Tk interface

From: Reimer Behrends <behrends@...>
Date: 1999-05-27 06:52:29 UTC
List: ruby-talk #350
There are a couple of minor bugs in the Tk interface. The enclosed
patch should take care of them, unless I've overlooked something,
but the calls seem to work now.

The patches fix the get method of scrollbars as well as
tag_configure/tag_cget for text widgets.

Also, I think that TkComm::uninstall_cmd() needs to strip the beginning
"rb_out " from its argument -- otherwise creating a lot of callbacks
will leak memory. But as I'm not entirely sure about that (I don't
yet understand the callback interface entirely), I've left it alone
for the time being.

				Reimer Behrends



diff -cr tk.rb tk.rb
*** tk.rb	Tue Apr 20 04:41:52 1999
--- tk.rb	Tue May 25 00:01:15 1999
***************
*** 2116,2122 ****
    end
  
    def get
!     ary1 = tk_send('get', path).split
      ary2 = []
      for i in ary1
        ary2.push number(i)
--- 2116,2122 ----
    end
  
    def get
!     ary1 = tk_send('get').split
      ary2 = []
      for i in ary1
        ary2.push number(i)
diff -cr tktext.rb tktext.rb
*** tktext.rb	Mon Apr 26 04:42:43 1999
--- tktext.rb	Sun May 23 11:48:43 1999
***************
*** 272,278 ****
    end
  
    def tag_cget(tag, key)
!     tk_tcl2ruby tk_call @t.path, 'tag', 'cget', tag, "-#{key}"
    end
  
    def tag_configure(tag, key, val=None)
--- 272,278 ----
    end
  
    def tag_cget(tag, key)
!     tk_tcl2ruby tk_call @path, 'tag', 'cget', tag, "-#{key}"
    end
  
    def tag_configure(tag, key, val=None)
***************
*** 289,295 ****
  	  || key == 'latinfont' || key == 'asciifont' )
  	tagfont_configure({key=>val})
        else
! 	tk_call 'tag', 'configure', tag, "-#{key}", val
        end
      end
    end
--- 289,295 ----
  	  || key == 'latinfont' || key == 'asciifont' )
  	tagfont_configure({key=>val})
        else
! 	tk_send 'tag', 'configure', tag, "-#{key}", val
        end
      end
    end

In This Thread

Prev Next