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
# File lib/ffi-tk/widget/tile/notebook.rb, line 88 def self.enable_traversal(nb) Tk.execute_only('ttk::notebook::enableTraversal', nb) end
Tk::Widget::new
# File lib/ffi-tk/widget/tile/notebook.rb, line 14 def initialize(parent = Tk.root, options = {}) super end
# File lib/ffi-tk/widget/tile/notebook.rb, line 9 def self.tk_command 'ttk::notebook' end
Public Instance Methods
# File lib/ffi-tk/widget/tile/notebook.rb, line 18 def add(window, options) execute_only(:add, window, options.to_tcl_options) end
# File lib/ffi-tk/widget/tile/notebook.rb, line 84 def enable_traversal self.class.enable_traversal self end
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
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
# File lib/ffi-tk/widget/tile/notebook.rb, line 80 def identify(x, y) execute(:identify, x, y) end
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
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
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
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
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