Panedwindow(3pm)
π Panedwindow β Tk::Panedwindow π
okay bestie, gather round, because we're about to talk about Tk::Panedwindow, which lives in the User Contributed Perl Documentation section of your manual, iykyk. This is the widget that makes panes, and panes are literally the main character of every good GUI. β¨
β¨ NAME β¨
Tk::Panedwindow β Create and manipulate Panedwindow widgets π«Ά
πΈ SYNOPSIS πΈ
$panedwindow = $parent->Panedwindow(?options?);
and the standard options you can throw at it are:
-background -height -width
-borderwidth -orient
-cursor -relief
that's the vibe check, now let's get into it π
π WIDGET-SPECIFIC OPTIONS π
these are the options that are hers, not inherited from anybody else. obsessed.
-handlepadβ Name:handlePad, Class:HandlePad. So when the sash handles get drawn, this says how far from the top end or the left end of the sash (depends on which way your widget is oriented, bestie) the handle gets drawn. Any value thatTk_GetPixelsaccepts is fine here. β¨-handlesizeβ Name:handleSize, Class:HandleSize. This is the side length of a sash handle. Handles are always drawn as squares, no exceptions, periodt. Any value accepted byTk_GetPixelsworks. π-opaqueresizeβ Name:opaqueResize, Class:OpaqueResize. This one decides whether panes get resized while you're moving a sash (true), or whether the resizing is deferred until you actually place the sash down (false). Choose your fighter π«Ά-sashcursorβ Name:sashCursor, Class:SashCursor. The mouse cursor to use when you're hovering over a sash. If it's null, thensb_h_double_arrowgets used for horizontal Panedwindows, andsb_v_double_arrowgets used for vertical Panedwindows. cute defaults ngl π¦-sashpadβ Name:sashPad, Class:SashPad. How much padding to leave on each side of a sash. Any value accepted byTk_GetPixels, you know the drill π-sashreliefβ Name:sashRelief, Class:SashRelief. The relief used when drawing a sash. May be any of the standard Tk relief values. iconic π-sashwidthβ Name:sashWidth, Class:SashWidth. The width of each sash. Any value accepted byTk_GetPixels. π-showhandleβ Name:showHandle, Class:ShowHandle. Whether sash handles should be shown at all. May be any valid boolean value. simple as that bestie β
π DESCRIPTION π
The Panedwindow method creates a new window (the one given by that $panedwindow argument) and makes it into a Panedwindow widget. You can pass extra options β the ones we just described above β on the command line or in the option database to configure aspects of the Panedwindow, like its default background color and relief. lowkey customizable queen π
A Panedwindow widget contains any number of panes, arranged horizontally or vertically depending on what -orient says. Each pane contains exactly one widget, and each pair of panes is separated by a moveable sash (moveable via mouse movements, bestie). Moving a sash causes the widgets on either side of that sash to be resized. it's giving interior design π¦
π WIDGET METHODS π
The Panedwindow method may be used to invoke various operations on the widget. General form goes like this:
$widget->method(?arg arg ...?);
And here are all the commands possible for Panedwindow widgets, no cap:
$widget->add(?window ...? ?option value ...?);β Add one or more windows to the Panedwindow, each one landing in a separate pane. The arguments are the names of one or more windows, followed by pairs of arguments that specify how to manage those windows. Option may have any of the values accepted by theconfiguresubcommand. π«Ά$widget->cget(option);β Returns the current value of the configuration option given by option. Option may have any of the values accepted by the Panedwindow command. β¨$widget->configure(?option?, ?value, option, value, ...?);β Query or modify the configuration options of the widget. If no option is specified, it returns a list describing all of the available options for$widget(peepTk::configurefor info on the format of that list). If option is specified with no value, then the command returns a list describing that one named option β and that list will be identical to the corresponding sublist of the value returned when 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 that case the command returns an empty string. Option may have any of the values accepted by the Panedwindow command. π$widget->forget(?window ...?);β Remove the pane containing$widgetfrom the Panedwindow. All geometry management options for$widgetwill be forgotten. it's giving "we don't know her" π$widget->identify(x, y);β 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, plus a word indicating whether it's over a sash or a handle, like[0, 'sash']or[2, 'handle']. If the point is over any other part of the Panedwindow, the result is an empty list. π$widget->proxy(?args?);β This command is used to query and change the position of the sash proxy, which is what you use for rubberband-style pane resizing. It can take any of these forms:$widget->proxyCoord;β Return a list containing the x and y coordinates of the most recent proxy location.$widget->proxyForget;β Remove the proxy from the display.$widget->proxyPlace(x, y);β Place the proxy at the given x and y coordinates.
$widget->sash(?args?);β This command is used to query and change the position of sashes in the Panedwindow. It can take any of these forms:$widget->sashCoord(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.$widget->sashDragto(index, x, y)This command computes the difference between the given coordinates and the coordinates given to the last sash coord command for the given sash. It then moves that sash the computed difference. The return value is the empty string. π$widget->sashMark(index, x, y);β Records x and y for the sash given by index; used together with laterdragtocommands to move the sash.$widget->sashPlace(index, x, y);β Place the sash given by index at the given coordinates.
$widget $widget->panecget(option);β Query a management option for$widget. Option may be any value allowed by thepaneconfiguresubcommand. π$widget $widget->paneconfigure(?option? ?value option value ...?);β Query or modify the management options for$widget. If no option is specified, it returns a list describing all of the available options for$widget(seeTk::configurefor info on the format of that list). If option is specified with no value, then the command returns a list describing the one named option β and that list will be identical to the corresponding sublist of the value returned when 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 that case the command returns an empty string. These are the options that are supported:-after => $widgetβ Insert the window after the window specified.$widgetshould be the name of a window already managed by$widget. π-before => $widgetβ Insert the window before the window specified.$widgetshould be the name of a window already managed by$widget. πΈ-height => sizeβ Specify a height for the window. The height will be the outer dimension of the window, including its border if it has one. If size is an empty string, or if-heightisn't specified, then the height requested internally by the window gets used initially; the height may later be adjusted by the movement of sashes in the Panedwindow. Size may be any value accepted byTk_GetPixels. π-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 β so the x dimension for horizontal Panedwindows, and 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. 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. 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. π-width => sizeβ Specify a width for the window. The width will be the outer dimension of the window, including its border if it has one. If size is an empty string, or if-widthisn't specified, then the width requested internally by the window gets used initially; the width may later be adjusted by the movement of sashes in the Panedwindow. Size may be any value accepted byTk_GetPixels. π
$widget->panes;β Returns an ordered list of the widgets managed by$widget. the whole roster, bestie π
π¦ 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 is moved, the sizes of the panes on each side of the sash β and therefore the widgets in those panes β get adjusted. it's giving teamwork makes the dream work π€
When a pane is resized from the outside (for example, it's packed to expand and fill, and the containing toplevel gets resized), space is added to the final pane in the window β that's the rightmost or bottommost one, depending on your orientation. π«Ά
β KEYWORDS β
Panedwindow, widget, geometry management
okay that's the whole page, and you absolutely ate it π
β¨ huge shoutout to the fine folks behind perl v5.40.1 and to the date 2025-04-13 for timestamping this iconic little manual page β no notes, perfect, periodt. πππ¦πΈ
π¦ where this page comes from
- debian trixie: perl-tk 1:804.036+dfsg1-5
- ubuntu questing: perl-tk 1:804.036+dfsg1-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms