panedwindow(n)
π panedwindow(n) β Tk Built-In Commands π
okay so quick vibe check before we dive in: this is the panedwindow(n) page from the Tk Built-In Commands manual. It's a long one, so it's split across two parts β this is part 1, bestie. Buckle up. π
β¨ NAME β¨
panedwindow β literally the command that creates and manipulates 'panedwindow' split container widgets. that's the whole job description. π
π¦ SYNOPSIS π¦
panedwindow pathName ?options?
πΈ STANDARD OPTIONS πΈ
these are the vanilla ones everyone gets:
-background-borderwidth-cursor-orient-relief
for the full tea on these, go check the options manual entry β it's got all the details. π«Ά
π WIDGET-SPECIFIC OPTIONS π
these are the ones that give panedwindow its whole main character energy. each one comes with a Command-Line Name, a Database Name, and a Database Class β yes bestie, you're gonna see all three for every single one, no skips. π
-handlepadβ so when sash handles are actually drawn, this says how far from the top or left end of the sash (which end depends on the orientation of the widget, iykyk) the handle gets drawn. may be any value accepted byTk_GetPixels.- Database Name:
handlePad - Database Class:
HandlePad
- Database Name:
-handlesizeβ sets the side length of a sash handle. handles are always drawn as squares, no exceptions, no rounded corners, periodt. may be any value accepted byTk_GetPixels.- Database Name:
handleSize - Database Class:
HandleSize
- Database Name:
-heightβ your desired height for the overall panedwindow widget. may be any value accepted byTk_GetPixels. if you give it an empty string, the widget gets made high enough to let all the contained widgets have their natural height. π¦- Database Name:
height - Database Class:
Height
- Database Name:
-opaqueresizeβ the big question: do panes get resized as a sash is moved (true), or is that resizing deferred until the sash is actually placed (false)? in the second case, a "ghost" version of the sash shows up during resizing so you can see where the panes will land when you release the mouse button. that "ghost" version of the sash is the proxy, and you can configure how it renders using the-proxybackground,-proxyborderwidthand-proxyreliefoptions. lowkey obsessed with the ghost sash concept. π»- Database Name:
opaqueResize - Database Class:
OpaqueResize
- Database Name:
-proxybackgroundβ the background color used when drawing the proxy. if it's an empty string, the value of the-backgroundoption gets used instead.- Database Name:
proxyBackground - Database Class:
ProxyBackground
- Database Name:
-proxyborderwidthβ the borderwidth of the proxy. may be any value accepted byTk_GetPixels.- Database Name:
proxyBorderWidth - Database Class:
ProxyBorderWidth
- Database Name:
-proxyreliefβ the relief used when drawing the proxy. may be any of the standard Tk relief values. if it's an empty string, the value of the-sashreliefoption gets used instead. slay, delegation. β¨- Database Name:
proxyRelief - Database Class:
ProxyRelief
- Database Name:
-sashcursorβ the mouse cursor to use when you're over a sash. if it's null,sb_h_double_arrowgets used for horizontal panedwindows, andsb_v_double_arrowgets used for vertical panedwindows.- Database Name:
sashCursor - Database Class:
SashCursor
- Database Name:
-sashpadβ how much padding to leave on each side of a sash. may be any value accepted byTk_GetPixels.- Database Name:
sashPad - Database Class:
SashPad
- Database Name:
-sashreliefβ the relief used when drawing a sash. may be any of the standard Tk relief values.- Database Name:
sashRelief - Database Class:
SashRelief
- Database Name:
-sashwidthβ the width of each sash. may be any value accepted byTk_GetPixels.- Database Name:
sashWidth - Database Class:
SashWidth
- Database Name:
-showhandleβ whether sash handles should be shown at all. may be any valid Tcl boolean value. π- Database Name:
showHandle - Database Class:
ShowHandle
- Database Name:
-widthβ your desired width for the overall panedwindow widget. may be any value accepted byTk_GetPixels. if you give it an empty string, the widget gets made wide enough to let all the contained widgets have their natural width.- Database Name:
width - Database Class:
Width
- Database Name:
π DESCRIPTION π
the panedwindow command creates a brand-new window (the one you named in the pathName argument, bestie) and turns it into a panedwindow widget. you can drop additional options on the command line or in the option database β the ones described above β to configure stuff about the panedwindow like its default background color and relief. and then panedwindow returns the path name of the brand-new window. easy. π«Ά
so a panedwindow widget contains any number of panes, laid out horizontally or vertically depending on whatever you set -orient to. each pane contains exactly one widget, and every pair of panes is separated by a sash that's moveable β via mouse movements, obviously. moving a sash causes the widgets on either side of that sash to be resized. it's giving split-screen main character energy, fr fr. π₯
π WIDGET COMMAND π
okay so the panedwindow command creates a new Tcl command whose name is the same as the path name of the panedwindow's window. This command may be used to invoke various operations on the widget. It has the following general form:
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 determine the exact behavior of the command. The following commands are possible for panedwindow widgets:
pathName add window ?window ...? ?option value ...?β adds one or more windows to the panedwindow, each in a separate pane. The arguments are the names of one or more windows, followed by pairs of arguments that specify how to manage the windows.Optionmay have any of the values accepted by theconfiguresubcommand.pathName cget optionβ returns the current value of the configuration option given byoption.optionmay have any of the values accepted by thepanedwindowcommand.pathName configure ?option? ?value option value ...?β queries or modifies the configuration options of the widget. If nooptionis specified, it returns a list describing all of the available options forpathName(seeTk_ConfigureInfofor information on the format of this list). Ifoptionis specified with novalue, 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 nooptionis 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.Optionmay have any of the values accepted by thepanedwindowcommand.pathName forget window ?window ...?β removes the pane containingwindowfrom the panedwindow. All geometry management options forwindowwill be forgotten. bye bestie πpathName identify x yβ identifies the panedwindow component underneath the point given byxandy, 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{0 sash}or{2 handle}. If the point is over any other part of the panedwindow, the result is an empty list.pathName panecget window optionβ queries a management option forwindow.Optionmay be any value allowed by thepaneconfiguresubcommand.pathName paneconfigure window ?option? ?value option value ...?β queries or modifies the management options forwindow. If nooptionis specified, it returns a list describing all of the available options forpathName(seeTk_ConfigureInfofor information on the format of this list). Ifoptionis specified with novalue, 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 nooptionis 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.windowshould be the name of a window already managed bypathName.-before windowβ insert the window before the window specified.windowshould be the name of a window already managed bypathName.-height sizeβ specify a height for the window. The height will be the outer dimension of the window including its border, if any. Ifsizeis an empty string, or if-heightis 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.Sizemay be any value accepted byTk_GetPixels.-hide booleanβ controls the visibility of a pane. When thebooleanis true (according toTcl_GetBoolean) the pane will not be visible, but it will still be maintained in the list of panes. sneaky hidden icon behavior β¨-minsize nβ specifies that the size of the window cannot be made less thann. 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 byTk_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 byTk_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 byTk_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.Styleis a string that contains zero or more of the charactersn,s,eorw. The string can optionally contain 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 bothnands(oreandw) 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.Whenis one ofalways,first,last,middle, andnever. 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 pane's current ratio of the whole. Thewhenvalues have the following definitions: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. Ifsizeis an empty string, or if-widthis 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.Sizemay be any value accepted byTk_GetPixels.
pathName panesβ returns an ordered list of the widgets managed bypathName.pathName proxy ?args?β this command is used to query and change the position of the sash proxy, used for rubberband-style pane resizing. It can take any of the following forms:pathName proxy coordβ return a list containing 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 givenxandycoordinates.
pathName sash ?args?β this command is used to query and change the position of sashes in the panedwindow. It can take any of the following forms:pathName sash coord indexβ return the current x and y coordinate pair for the sash given byindex.Indexmust be an integer between0and1less 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β this command computes the difference between the given coordinates and the coordinates given to the lastsash markcommand for the given sash. It then moves that sash the computed difference. The return value is the empty string.pathName sash mark index x yβ recordsxandyfor the sash given byindex; used in conjunction with latersash dragtocommands to move the sash.pathName sash place index x yβ place the sash given byindexat the given coordinates.
π¦ RESIZING PANES π¦
A pane is resized by grabbing the sash (or sash handle if present) and dragging with the mouse. This is accomplished via mouse motion bindings on the widget. When a sash is moved, the sizes of the panes on each side of the sash, and thus the widgets in those panes, are adjusted. drag queen behavior but make it geometry π
When a pane is resized from outside (e.g. it is packed to expand and fill, and the containing toplevel is resized), space is added to the final (rightmost or bottommost) pane in the window.
Unlike child windows managed by e.g. pack or grid, 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 these have become mapped. Therefore it may be advisable, particularly when creating layouts interactively, to not add a pane to the panedwindow widget until after the geometry requests of that pane has been finalized (i.e., all components of the pane inserted, all options affecting geometry set to their proper values, etc.). fr fr, set it up first, then add it π«Ά
π SEE ALSO π
ttk::panedwindow(n)
π KEYWORDS π
panedwindow, widget, geometry management
okay bye bestie π this page is from Tk 8.4, panedwindow(n), and the footer doesn't list a date β so that's the source/version tea, periodt πβ¨
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- 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-1017 on : a language model's rewrite of the original, under its terms