class Tk::Tile::Notebook

Tk::Tile::Notebook widget manages a collection of windows and displays a single one at a time. Each slave window is associated with a tab, which the user may select to change the currently-displayed window.

Public Class Methods

enable_traversal(nb) click to toggle source
# File lib/ffi-tk/widget/tile/notebook.rb, line 88
def self.enable_traversal(nb)
  Tk.execute_only('ttk::notebook::enableTraversal', nb)
end
new(parent = Tk.root, options = {}) click to toggle source
Calls superclass method Tk::Widget::new
# File lib/ffi-tk/widget/tile/notebook.rb, line 14
def initialize(parent = Tk.root, options = {})
  super
end
tk_command() click to toggle source
# File lib/ffi-tk/widget/tile/notebook.rb, line 9
def self.tk_command
  'ttk::notebook'
end

Public Instance Methods

add(window, options) click to toggle source
# File lib/ffi-tk/widget/tile/notebook.rb, line 18
def add(window, options)
  execute_only(:add, window, options.to_tcl_options)
end
enable_traversal() click to toggle source
# File lib/ffi-tk/widget/tile/notebook.rb, line 84
def enable_traversal
  self.class.enable_traversal self
end
forget(window, *windows) click to toggle source

Remove the pane containing window from the panedwindow. All geometry management options for window will be forgotten.

# File lib/ffi-tk/widget/tile/notebook.rb, line 62
def forget(window, *windows)
  execute_only(:forget, window, *windows)
end
hide(tabid) click to toggle source

Hides the tab specified by tabid. The tab will not be displayed, but the associated window remains managed by the notebook and its configuration remembered. Hidden tabs may be restored with the add command.

# File lib/ffi-tk/widget/tile/notebook.rb, line 70
def hide(tabid)
  execute_only(:hide, tabid)
end
identify(x, y) click to toggle source
# File lib/ffi-tk/widget/tile/notebook.rb, line 80
def identify(x, y)
  execute(:identify, x, y)
end
index(tabid) click to toggle source

Returns the numeric index of the tab specified by tabid, or the total number of tabs if tabid is the string 'end'.

# File lib/ffi-tk/widget/tile/notebook.rb, line 76
def index(tabid)
  execute(:index, tabid).to_i
end
insert(pos, window, options = {}) click to toggle source

Inserts a pane at the specified position. pos is either the string end, an integer index, or the name of a managed subwindow. If subwindow is already managed by the notebook, moves it to the specified position.

# File lib/ffi-tk/widget/tile/notebook.rb, line 44
def insert(pos, window, options = {})
  execute_only(:insert, pos, window, options.to_tcl_options)
end
select(window = None) click to toggle source

Selects the specified tab. The associated slave window will be displayed, and the previously-selected window (if different) is unmapped. If tabid is omitted, returns the widget name of the currently selected pane.

# File lib/ffi-tk/widget/tile/notebook.rb, line 52
def select(window = None)
  if None == window
    execute(:select)
  else
    execute_only(:select, window)
  end
end
tab(window, options = None) click to toggle source

Query or modify the options of the specific tab. If no -option is specified, returns a dictionary of the tab option values. If one -option is specified, returns the value of that option. Otherwise, sets the -options to the corresponding values.

# File lib/ffi-tk/widget/tile/notebook.rb, line 32
def tab(window, options = None)
  if None == options
    execute(:tab, window)
  else
    execute_only(:tab, window, options.to_tcl_options)
  end
end
tabs() click to toggle source

Returns the list of windows managed by the notebook.

# File lib/ffi-tk/widget/tile/notebook.rb, line 23
def tabs
  execute(:tabs).to_a
end