panedwindow(3tk)
β¨ NAME β¨
panedwindow β create and manipulate panedwindow split container widgets. This one lives in the Tk Built-In Commands manual as panedwindow(3tk). π
πΈ SYNOPSIS πΈ
panedwindow pathName ?options?
π STANDARD OPTIONS π
These are the standard options, bestie:
-background-borderwidth-cursor-orient-relief
See the options manual entry for details on the standard options.
π WIDGET-SPECIFIC OPTIONS π
Okay so here's the whole menu of widget-specific options. Every command-line name, database name, and database class is staying, no cap.
-handlepadβ Command-Line Name:-handlepad; Database Name:handlePad; Database Class:HandlePad. When sash handles are drawn, specifies the distance from the top or left end of the sash (depending on the orientation of the widget) at which to draw the handle. May be any value accepted byTk_GetPixels.-handlesizeβ Command-Line Name:-handlesize; Database Name:handleSize; Database Class:HandleSize. Specifies the side length of a sash handle. Handles are always drawn as squares. May be any value accepted byTk_GetPixels.-heightβ Command-Line Name:-height; Database Name:height; Database Class:Height. Specifies a desired height for the overall panedwindow widget. May be any value accepted byTk_GetPixels. If an empty string, the widget will be made high enough to allow all contained widgets to have their natural height.-opaqueresizeβ Command-Line Name:-opaqueresize; Database Name:opaqueResize; Database Class:OpaqueResize. Specifies whether panes should be resized as a sash is moved (true), or if resizing should be deferred until the sash is placed (false). In the latter case, a βghostβ version of the sash is displayed during the resizing to show where the panes will be resized to when releasing the mouse button. This βghostβ version of the sash is the proxy. Its rendering can be configured using the-proxybackground,-proxyborderwidthand-proxyreliefoptions.-proxybackgroundβ Command-Line Name:-proxybackground; Database Name:proxyBackground; Database Class:ProxyBackground. Background color to use when drawing the proxy. If an empty string, the value of the-backgroundoption will be used.-proxyborderwidthβ Command-Line Name:-proxyborderwidth; Database Name:proxyBorderWidth; Database Class:ProxyBorderWidth. Specifies the borderwidth of the proxy. May be any value accepted byTk_GetPixels.-proxyreliefβ Command-Line Name:-proxyrelief; Database Name:proxyRelief; Database Class:ProxyRelief. Relief to use when drawing the proxy. May be any of the standard Tk relief values. If an empty string, the value of the-sashreliefoption will be used.-sashcursorβ Command-Line Name:-sashcursor; Database Name:sashCursor; Database Class:SashCursor. Mouse cursor to use when over a sash. If null,sb_h_double_arrowwill be used for horizontal panedwindows, andsb_v_double_arrowwill be used for vertical panedwindows.-sashpadβ Command-Line Name:-sashpad; Database Name:sashPad; Database Class:SashPad. Specifies the amount of padding to leave of each side of a sash. May be any value accepted byTk_GetPixels.-sashreliefβ Command-Line Name:-sashrelief; Database Name:sashRelief; Database Class:SashRelief. Relief to use when drawing a sash. May be any of the standard Tk relief values.-sashwidthβ Command-Line Name:-sashwidth; Database Name:sashWidth; Database Class:SashWidth. Specifies the width of each sash. May be any value accepted byTk_GetPixels.-showhandleβ Command-Line Name:-showhandle; Database Name:showHandle; Database Class:ShowHandle. Specifies whether sash handles should be shown. May be any valid Tcl boolean value.-widthβ Command-Line Name:-width; Database Name:width; Database Class:Width. Specifies a desired width for the overall panedwindow widget. May be any value accepted byTk_GetPixels. If an empty string, the widget will be made wide enough to allow all contained widgets to have their natural width.
π¦ DESCRIPTION π¦
Okay so the panedwindow command creates a new window (that's your pathName argument) and makes it into a panedwindow widget. Additional options, described above, may be specified on the command line or in the option database to configure aspects of the panedwindow such as its default background color and relief. The panedwindow command returns the path name of the new window. π
A panedwindow widget contains any number of panes, arranged horizontally or vertically, according to the value of the -orient option. Each pane contains one widget, and each pair of panes is separated by a moveable (via mouse movements) sash. Moving a sash causes the widgets on either side of the sash to be resized. π¦
π WIDGET COMMAND π
Okay bestie, so the panedwindow command makes a brand-new Tcl command, and that command's name is literally the same as the path name of the panedwindow's window. Wild, I know. You use this command to do all the operations on the widget. General form goes like this:
pathName option ?arg ...?
PathName is the name of the command, which is the same as the panedwindow widget's path name. Option and the args decide exactly what happens. Here are the commands a panedwindow widget can do for you π
pathName add window ?window ...? ?option value ...?β adds one or more windows to the panedwindow, each one getting its own separate pane π«Ά. The arguments are the names of one or more windows, followed by pairs of arguments that say how to manage those windows. Option can be any of the values that theconfiguresubcommand accepts.pathName cget optionβ hands you back the current value of the configuration option given by option. Option can be any value that thepanedwindowcommand accepts.pathName configure ?option? ?value option value ...?β query or modify the widget's configuration options β¨. If you don't pass an option, it returns a list describing all the available options forpathName(peepTk_ConfigureInfofor the tea on how that list is formatted). If you pass option with no value, the command returns a list describing that one named option (and that list is identical to the matching sublist of what you'd get with no option specified). And if you pass one or more option-value pairs, the command changes the given widget option(s) to the given value(s) β and in that case it returns an empty string, no cap. Option can be any value thepanedwindowcommand accepts.pathName forget window ?window ...?β removes the pane containing window from the panedwindow. All geometry management options for window get forgotten, like it never happened π.pathName identify x yβ figures out which panedwindow component is underneath the point given by x and y, in window coordinates. If the point is over a sash or a sash handle, you get a two element list with the index of the sash or handle plus a word saying whether it's a sash or a handle β something like{0 sash}or{2 handle}. If the point is over literally any other part of the panedwindow, you get an empty list. that's it, that's the vibe.pathName panecget window optionβ queries a management option for window. Option can be any value allowed by thepaneconfiguresubcommand.pathName paneconfigure window ?option? ?value option value ...?β query or modify the management options for window. If you don't give an option, it returns a list describing all the available options forpathName(again,Tk_ConfigureInfohas the format deets). If you give option with no value, you get a list describing that one named option (identical to the corresponding sublist from the no-option version). And if you give one or more option-value pairs, it modifies the given widget option(s) to the given value(s) and returns an empty string. These are the options it supports π:-after windowβ insert the window after the window specified. window should be the name of a window that's already managed bypathName.-before windowβ insert the window before the window specified. window should be the name of a window that's already managed bypathName.-height sizeβ specify a height for the window. This height is the outer dimension of the window, including its border, if it has one. If size is an empty string, or if-heightisn't specified at all, then the height requested internally by the window gets used initially β and that height may later get adjusted by sashes moving around in the panedwindow. Size can be any value accepted byTk_GetPixels.-hide booleanβ controls whether a pane is visible or not π. When the boolean is true (perTcl_GetBoolean) the pane won't be visible, but it still stays in the list of panes. sneaky but valid.-minsize nβ says the size of the window can't go below n. Heads up: this constraint only affects the size of the widget in the paned dimension β that's the x dimension for horizontal panedwindows, and the y dimension for vertical panedwindows. Can be any value accepted byTk_GetPixels.-padx nβ a non-negative value saying how much extra space to leave on each side of the window in the X-direction. The value can take any form accepted byTk_GetPixels.-pady nβ a non-negative value saying how much extra space to leave on each side of the window in the Y-direction. The value can take any form accepted byTk_GetPixels.-sticky styleβ if a window's pane is bigger than the window's requested dimensions, this option positions (or stretches) the window inside its pane. Style is a string containing zero or more of the charactersn,s,eorw. The string can optionally contain spaces or commas, but those get ignored, so do not stress. Each letter refers to a side (north, south, east, or west) that the window will "stick" to. If bothnands(oreandw) are specified, the window gets stretched to fill the entire height (or width) of its cavity. iconic behaviour honestly.-stretch whenβ controls how extra space gets handed out to each of the panes. When is one ofalways,first,last,middle, andnever. The panedwindow calculates the required size of all its panes, and any remaining (or deficit) space gets distributed to the panes marked for stretching. That space is distributed based on each pane's current ratio of the whole. The when values mean: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 is the outer dimension of the window, including its border, if any. If size is an empty string, or if-widthisn't specified, then the width requested internally by the window gets used initially β and it may later get adjusted by sashes moving around in the panedwindow. Size can be any value accepted byTk_GetPixels.
pathName panesβ returns an ordered list of the widgets managed bypathName. πpathName proxy ?args?β used to query and change the position of the sash proxy, which is the whole rubberband-style pane resizing situation. It can take any of these forms:pathName proxy coordβ return a list with the x and y coordinates of the most recent proxy location.pathName proxy forgetβ remove the proxy from the display.pathName proxy place x yβ place the proxy at the given x and y coordinates.
pathName sash ?args?β used to query and change the position of sashes in the panedwindow. It can take any of these forms:pathName sash coord indexβ 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.pathName sash dragto index x yβ computes the difference between the given coordinates and the coordinates given to the lastsash markcommand for that sash, then moves that sash by the computed difference. The return value is the empty string.pathName sash mark index x yβ records x and y for the sash given by index; used together with latersash dragtocommands to move the sash.pathName sash place index x yβ place the sash given by index at the given coordinates.
π¦ RESIZING PANES π¦
A pane gets resized by grabbing the sash (or the sash handle, if there is one) and dragging with the mouse. This happens via mouse motion bindings on the widget. When a sash moves, the sizes of the panes on each side of that sash β and therefore the widgets inside those panes β get adjusted. slay.
When a pane is resized from the outside (like, it's packed to expand and fill, and the containing toplevel gets resized), space is added to the final (rightmost or bottommost) pane in the window.
Real talk, bestie: unlike child windows managed by e.g.packorgrid, the panes managed by a panedwindow do not change width or height to accommodate changes in the requested widths or heights of the panes, once those have become mapped. So it may be advisable β especially when you're creating layouts interactively β to not add a pane to the panedwindow widget until after that pane's geometry requests have been finalized. That means all components of the pane inserted, all options affecting geometry set to their proper values, etc. Get your life together first, then add the pane. π
πΈ SEE ALSO πΈ
ttk::panedwindow(3tk)
β KEYWORDS β
panedwindow, widget, geometry management
And that's the whole page, babe π«Ά this one's from Tk 8.4 and it lives in the panedwindow(3tk) manpage β go forth and pane responsibly, you absolute icon πβ¨
π¦ where this page comes from
- debian trixie: tk9.0-doc 9.0.1-3
- ubuntu questing: tk9.0-doc 9.0.2-1
- ubuntu resolute: tk9.0-doc 9.0.3-1
- ubuntu stonking: tk9.0-doc 9.0.4-1
- Copyright (c) 1992 The Regents of the University of California
- Copyright (c) 1994-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms