Module: Tk::Menu::TkInternalFunction

Defined in:
lib/tk/menu.rb

Class Method Summary collapse

Class Method Details

.next_entry(menu, delta) ⇒ Object



411
412
413
414
415
# File 'lib/tk/menu.rb', line 411

def next_entry(menu, delta)
  # delta is increment value of entry index.
  # For example, +1 denotes 'next entry' and -1 denotes 'previous entry'.
  Tk.tk_call('::tk::MenuNextEntry', menu, delta)
end

.next_menu(menu, dir = 'next') ⇒ Object

These methods calls internal functions of Tcl/Tk. So, They may not work on your Tcl/Tk.



399
400
401
402
403
404
405
406
407
408
409
# File 'lib/tk/menu.rb', line 399

def next_menu(menu, dir='next')
  dir = dir.to_s
  case dir
  when 'next', 'forward', 'down'
    dir = 'right'
  when 'previous', 'backward', 'up'
    dir = 'left'
  end

  Tk.tk_call('::tk::MenuNextMenu', menu, dir)
end