Class: Tk::PanedWindow

Inherits:
Widget show all
Includes:
Cget, Configure
Defined in:
lib/ffi-tk/widget/panedwindow.rb

Direct Known Subclasses

Tile::PanedWindow

Constant Summary

Constants included from Cget

Cget::CGET_MAP

Constants included from WM

WM::WM_ATTRIBUTES_HINTS

Instance Attribute Summary

Attributes inherited from Widget

#tk_parent, #tk_pathname

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Cget

#cget, option_hash_to_tcl, option_to_ruby, type_to_ruby

Methods included from Configure

#configure

Methods inherited from Widget

#execute, #execute_only, #focus, #focus_next, #focus_prev, #initialize, #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

destroy, #destroy

Methods included from Bind

bind, #bind, unbind, #unbind

Methods included from Bindtags

bindtags, #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 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 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 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

This class inherits a constructor from Tk::Widget

Class Method Details

.tk_commandObject



6
7
8
# File 'lib/ffi-tk/widget/panedwindow.rb', line 6

def self.tk_command
  'panedwindow'
end

Instance Method Details

#add(window, *arguments) ⇒ Object

Add one or more windows to the panedwindow, each in a separate pane. The arguments consist of the names of one or more windows followed by pairs of arguments that specify how to manage the windows. Option may have any of the values accepted by the configure subcommand.



14
15
16
17
18
19
20
21
22
# File 'lib/ffi-tk/widget/panedwindow.rb', line 14

def add(window, *arguments)
  options, windows = arguments.partition { |arg| arg.respond_to?(:to_tcl_options) }

  if option = options.first
    execute(:add, window, *windows, option.to_tcl_options)
  else
    execute(:add, window, *windows)
  end
end

#forget(window, *windows) ⇒ Object

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



26
27
28
# File 'lib/ffi-tk/widget/panedwindow.rb', line 26

def forget(window, *windows)
  execute_only(:forget, window, *windows)
end

#identify(x, y) ⇒ Object

Identify the panedwindow component underneath the point given by x and y, in window coordinates. If the point is over a sash or a sash handle, the result is a two element list containing the index of the sash or handle, and a word indicating whether it is over a sash or a handle, such as sash or handle. If the point is over any other part of the panedwindow, the result is an empty list.



37
38
39
# File 'lib/ffi-tk/widget/panedwindow.rb', line 37

def identify(x, y)
  execute(:identify, x, y)
end

#panecget(window, option) ⇒ Object

Query a management option for window. Option may be any value allowed by the paneconfigure subcommand.



86
87
88
# File 'lib/ffi-tk/widget/panedwindow.rb', line 86

def panecget(window, option)
  execute(:panecget, window, option.to_tcl_option)
end

#paneconfigure(window, options = None) ⇒ Object

Query or modify the management options for window.

If no options is specified, returns a list describing all of the available options for window (see Tk_ConfigureInfo for information on the format of this list).

If options is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified).

If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string.

The following options are supported:

:after window
  Insert the window after the window specified.
  window should be the name of a window already managed by +window+.

:before window
  Insert the window before the window specified.
  window should be the name of a window already managed by +window+.

:height size
  Specify a height for the window.
  The height will be the outer dimension of the window including its
  border, if any.
  If size is an empty string, or if -height is not specified, then the
  height requested internally by the window will be used initially; the
  height may later be adjusted by the movement of sashes in the
  panedwindow. Size may be any value accepted by Tk_GetPixels.

:hide boolean
  Controls the visibility of a pane.
  When the boolean is true (according to Tcl_GetBoolean) the pane will
  not be visible, but it will still be maintained in the list of panes.

:minsize n
  Specifies that the size of the window cannot be made less than n.
  This constraint only affects the size of the widget in the paned
  dimension -- the x dimension for horizontal panedwindows, the y
  dimension for vertical panedwindows.
  May be any value accepted by Tk_GetPixels.

:padx n
  Specifies a non-negative value indicating how much extra space to
  leave on each side of the window in the X-direction.
  The value may have any of the forms accepted by Tk_GetPixels.

:pady n
  Specifies a non-negative value indicating how much extra space to
  leave on each side of the window in the Y-direction.
  The value may have any of the forms accepted by Tk_GetPixels.
:sticky style
  If a window's pane is larger than the requested dimensions of the
  window, this option may be used to position (or stretch) the window
  within its pane.
  Style is a string that contains zero or more of the characters n, s, e
  or w.
  The string can optionally contains spaces or commas, but they are
  ignored. Each letter refers to a side (north, south, east, or west)
  that the window will "stick" to.
  If both n and s (or e and w) are specified, the window will be
  stretched to fill the entire height (or width) of its cavity.
:stretch when
  Controls how extra space is allocated to each of the panes.
  When is one of always, first, last, middle, and never.
  The panedwindow will calculate the required size of all its panes.
  Any remaining (or deficit) space will be distributed to those panes
  marked for stretching.
  The space will be distributed based on each panes current ratio of the
  whole.
  The when values have the following definition:
    :always
      This pane will always stretch.
    :first
      Only if this pane is the first pane (left-most or top-most) will
      it stretch.
    :last
      Only if this pane is the last pane (right-most or bottom-most)
      will it stretch. This is the default value.
    :middle
      Only if this pane is not the first or last pane will it stretch.
    :never
      This pane will never stretch.

:width size
  Specify a width for the window.
  The width will be the outer dimension of the window including its
  border, if any.
  If size is an empty string, or if -width is not specified, then the
  width requested internally by the window will be used initially; the
  width may later be adjusted by the movement of sashes in the
  panedwindow. Size may be any value accepted by Tk_GetPixels.


184
185
186
# File 'lib/ffi-tk/widget/panedwindow.rb', line 184

def paneconfigure(window, options = None)
  common_configure([:paneconfigure, window], options)
end

#panes(window = None) ⇒ Object

Returns an ordered list of the widgets managed by window.



189
190
191
# File 'lib/ffi-tk/widget/panedwindow.rb', line 189

def panes(window = None)
  execute(:panes, window).to_a
end

#proxy_coordObject

Return a list containing the x and y coordinates of the most recent proxy location.



43
44
45
# File 'lib/ffi-tk/widget/panedwindow.rb', line 43

def proxy_coord
  execute(:proxy, :coord).to_a
end

#proxy_forgetObject

Remove the proxy from the display.



48
49
50
# File 'lib/ffi-tk/widget/panedwindow.rb', line 48

def proxy_forget
  execute(:proxy, :forget)
end

#proxy_place(x, y) ⇒ Object

Place the proxy at the given x and y coordinates.



53
54
55
# File 'lib/ffi-tk/widget/panedwindow.rb', line 53

def proxy_place(x, y)
  execute(:proxy, :place, x, y)
end

#sash_coord(index) ⇒ Object

Return the current x and y coordinate pair for the sash given by index. Index must be an integer between 0 and 1 less than the number of panes in the panedwindow. The coordinates given are those of the top left corner of the region containing the sash.



62
63
64
# File 'lib/ffi-tk/widget/panedwindow.rb', line 62

def sash_coord(index)
  execute(:sash, :coord, index)
end

#sash_dragto(index, x, y) ⇒ Object

This command computes the difference between the given coordinates and the coordinates given to the last sash mark command for the given sash. It then moves that sash the computed difference.



69
70
71
# File 'lib/ffi-tk/widget/panedwindow.rb', line 69

def sash_dragto(index, x, y)
  execute_only(:sash, :dragto, index, x, y)
end

#sash_mark(index, x, y) ⇒ Object

Records x and y for the sash given by index; used in conjunction with later sash dragto commands to move the sash.



75
76
77
# File 'lib/ffi-tk/widget/panedwindow.rb', line 75

def sash_mark(index, x, y)
  execute(:sash, :mark, index, x, y)
end

#sash_place(index, x, y) ⇒ Object

Place the sash given by index at the given coordinates.



80
81
82
# File 'lib/ffi-tk/widget/panedwindow.rb', line 80

def sash_place(index, x, y)
  execute(:sash, :place, index, x, y)
end