Class: Tk::Tile::Notebook
- Includes:
- TileWidget
- Defined in:
- lib/ffi-tk/widget/tile/notebook.rb
Overview
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.
Constant Summary
Constants included from WM
Instance Attribute Summary
Attributes inherited from Widget
Class Method Summary collapse
Instance Method Summary collapse
- #add(window, options) ⇒ Object
- #enable_traversal ⇒ Object
-
#forget(window, *windows) ⇒ Object
Remove the pane containing window from the panedwindow.
-
#hide(tabid) ⇒ Object
Hides the tab specified by
tabid
. - #identify(x, y) ⇒ Object
-
#index(tabid) ⇒ Object
Returns the numeric index of the tab specified by
tabid
, or the total number of tabs if tabid is the string ‘end’. -
#initialize(parent = Tk.root, options = {}) ⇒ Notebook
constructor
A new instance of Notebook.
-
#insert(pos, window, options = {}) ⇒ Object
Inserts a pane at the specified position.
-
#select(window = None) ⇒ Object
Selects the specified tab.
-
#tab(window, options = None) ⇒ Object
Query or modify the options of the specific tab.
-
#tabs ⇒ Object
Returns the list of windows managed by the notebook.
Methods included from TileWidget
#grid, #state, #style, #ttk_state
Methods included from Grid
anchor, bbox, columnconfigure, configure, forget, #grid_anchor, #grid_bbox, #grid_columnconfigure, #grid_configure, #grid_forget, #grid_info, #grid_location, #grid_propagate, #grid_remove, #grid_rowconfigure, #grid_size, #grid_slave, #grid_slaves, info, location, propagate, remove, rowconfigure, size, slave, slaves
Methods inherited from Widget
#execute, #execute_only, #focus, #focus_next, #focus_prev, #lower, #raise, #to_tcl
Methods included from Pack
configure, forget, info, pack, #pack, #pack_configure, #pack_forget, #pack_info, #pack_propagate, #pack_slaves, propagate, slaves
Methods included from Destroy
Methods included from Bind
Methods included from Bindtags
Methods included from WM
aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, forget, frame, geometry, grid, group, iconbitmap, iconbitmap_default, iconify, iconmask, iconname, iconphoto, iconphoto_default, iconposition, iconwindow, manage, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, withdraw, #wm_aspect, #wm_aspect=, #wm_attributes, #wm_client, #wm_client=, #wm_colormapwindows, #wm_colormapwindows=, #wm_command, #wm_command=, #wm_deiconify, #wm_focusmodel, #wm_focusmodel=, #wm_forget, #wm_frame, #wm_geometry, #wm_geometry=, #wm_grid, #wm_grid=, #wm_group, #wm_group=, #wm_iconbitmap, #wm_iconbitmap=, #wm_iconbitmap_default, #wm_iconbitmap_default=, #wm_iconify, #wm_iconmask, #wm_iconmask=, #wm_iconname, #wm_iconname=, #wm_iconphoto, #wm_iconphoto=, #wm_iconphoto_default, #wm_iconphoto_default=, #wm_iconposition, #wm_iconposition=, #wm_iconwindow, #wm_iconwindow=, #wm_manage, #wm_maxsize, #wm_minsize, #wm_overrideredirect, #wm_overrideredirect=, #wm_positionfrom, #wm_positionfrom=, #wm_protocol, #wm_resizable, #wm_sizefrom, #wm_sizefrom=, #wm_stackorder, #wm_state, #wm_state=, #wm_title, #wm_title=, #wm_transient, #wm_transient=, #wm_withdraw
Methods included from Winfo
atom, atomname, cells, children, class_name, colormapfull, containing, depth, exists, fpixels, geometry, height, id, interps, ismapped, manager, name, parent, pathname, pixels, pointerx, pointerxy, pointery, reqheight, reqwidth, rgb, rootx, rooty, screen, screencells, screendepth, screenheight, screenmmheight, screenmmwidth, screenvisual, screenwidth, server, toplevel, viewable, visual, visualid, visualsavailable, vrootheight, vrootwidth, vrootx, vrooty, width, #winfo_atom, #winfo_atomname, #winfo_cells, #winfo_children, #winfo_class, #winfo_colormapfull, #winfo_containing, #winfo_depth, #winfo_exists, #winfo_fpixels, #winfo_geometry, #winfo_height, #winfo_id, #winfo_interps, #winfo_ismapped, #winfo_manager, #winfo_name, #winfo_parent, #winfo_pathname, #winfo_pixels, #winfo_pointerx, #winfo_pointerxy, #winfo_pointery, #winfo_reqheight, #winfo_reqwidth, #winfo_rgb, #winfo_rootx, #winfo_rooty, #winfo_screen, #winfo_screencells, #winfo_screendepth, #winfo_screenheight, #winfo_screenmmheight, #winfo_screenmmwidth, #winfo_screenvisual, #winfo_screenwidth, #winfo_server, #winfo_toplevel, #winfo_viewable, #winfo_visual, #winfo_visualid, #winfo_visualsavailable, #winfo_vrootheight, #winfo_vrootwidth, #winfo_vrootx, #winfo_vrooty, #winfo_width, #winfo_x, #winfo_y, x, y
Methods included from Clipboard
append, clear, #clipboard_append, #clipboard_clear, #clipboard_get, #clipboard_set, get, set
Methods included from Place
configure, forget, info, place, #place, #place_configure, #place_forget, #place_info, #place_slaves, slaves
Methods included from Tk::TkCmd
appname, caret, inactive, scaling, #tk_appname, #tk_appname=, #tk_caret, #tk_inactive, #tk_scaling, #tk_scaling=, #tk_useinputmethods, #tk_useinputmethods=, #tk_windowingsystem, useinputmethods, windowingsystem
Constructor Details
Class Method Details
.enable_traversal(nb) ⇒ Object
85 86 87 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 85 def self.enable_traversal(nb) Tk.execute_only('ttk::notebook::enableTraversal', nb) end |
.tk_command ⇒ Object
8 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 8 def self.tk_command; 'ttk::notebook'; end |
Instance Method Details
#add(window, options) ⇒ Object
15 16 17 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 15 def add(window, ) execute_only(:add, window, .) end |
#enable_traversal ⇒ Object
81 82 83 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 81 def enable_traversal self.class.enable_traversal self end |
#forget(window, *windows) ⇒ Object
Remove the pane containing window from the panedwindow. All geometry management options for window will be forgotten.
59 60 61 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 59 def forget(window, *windows) execute_only(:forget, window, *windows) end |
#hide(tabid) ⇒ Object
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.
67 68 69 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 67 def hide(tabid) execute_only(:hide, tabid) end |
#identify(x, y) ⇒ Object
77 78 79 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 77 def identify(x, y) execute(:identify, x, y) end |
#index(tabid) ⇒ Object
Returns the numeric index of the tab specified by tabid
, or the total number of tabs if tabid is the string ‘end’.
73 74 75 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 73 def index(tabid) execute(:index, tabid).to_i end |
#insert(pos, window, options = {}) ⇒ Object
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.
41 42 43 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 41 def insert(pos, window, = {}) execute_only(:insert, pos, window, .) end |
#select(window = None) ⇒ Object
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.
49 50 51 52 53 54 55 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 49 def select(window = None) if None == window execute(:select) else execute_only(:select, window) end end |
#tab(window, options = None) ⇒ Object
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.
29 30 31 32 33 34 35 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 29 def tab(window, = None) if None == execute(:tab, window) else execute_only(:tab, window, .) end end |
#tabs ⇒ Object
Returns the list of windows managed by the notebook.
20 21 22 |
# File 'lib/ffi-tk/widget/tile/notebook.rb', line 20 def tabs execute(:tabs).to_a end |