Tk bind help

rtk’rs-

i have a tk app that has a TkText setup with a TkScrollbar:

@text = TkText.new @widget, :background=>BACKGROUND_WHITE
@text.insert 'end', text
@text.configure :state=>'disabled'
@textscroll = TkScrollbar.new @text

@textscroll.configure :command => proc {|*args| @text.yview *args }
@text.yscrollcommand proc{|first,last| @textscroll.set first,last}

and i want to configure ‘page down’, ‘page up’, ‘down arrow’, 'up arrow, etc.
events to do the sensible thing

this seems to do nothing…

@text.bind ‘Down’, proc{puts ‘Down’}
@text.bind ‘downarrow’, proc{puts ‘downarrow’}

obivously i’ll need to update both @text and @textscroll on these events
(up/down a page or line)

any ideas on how to accomplish this most easily?

-a

···

EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
URL :: Solar-Terrestrial Physics Data | NCEI
TRY :: for l in ruby perl;do $l -e “print "\x3a\x2d\x29\x0a"”;done
===============================================================================

and i want to configure ‘page down’, ‘page up’, ‘down arrow’, 'up arrow, etc.
events to do the sensible thing

this seems to do nothing…

@text.bind ‘Down’, proc{puts ‘Down’}
@text.bind ‘downarrow’, proc{puts ‘downarrow’}

The following writes out “Down” when you press the down arrow:

txt=TkText.new()
txt.bind(“Down”, proc {puts “Down”})

The PgDn/PgUp keys normally are referred as ‘Next’ and ‘Prior’ key
symbols.

For real scrolling, you just have to use the ‘see’ method of TkText
(check out man 3tk text).

Ferenc

thanks. that worked.

-a

···

On Thu, 1 Apr 2004, Ferenc Engard wrote:

and i want to configure ‘page down’, ‘page up’, ‘down arrow’, 'up arrow, etc.
events to do the sensible thing

this seems to do nothing…

@text.bind ‘Down’, proc{puts ‘Down’}
@text.bind ‘downarrow’, proc{puts ‘downarrow’}

The following writes out “Down” when you press the down arrow:

txt=TkText.new()
txt.bind(“Down”, proc {puts “Down”})

The PgDn/PgUp keys normally are referred as ‘Next’ and ‘Prior’ key
symbols.

For real scrolling, you just have to use the ‘see’ method of TkText
(check out man 3tk text).

Ferenc

EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
URL :: Solar-Terrestrial Physics Data | NCEI
TRY :: for l in ruby perl;do $l -e “print "\x3a\x2d\x29\x0a"”;done
===============================================================================