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 that Tk_GetPixels accepts 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 by Tk_GetPixels works. πŸŽ€
  • -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, then sb_h_double_arrow gets used for horizontal Panedwindows, and sb_v_double_arrow gets 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 by Tk_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 by Tk_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 the configure subcommand. 🫢
  • $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 (peep Tk::configure for 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 $widget from the Panedwindow. All geometry management options for $widget will 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 later dragto commands 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 the paneconfigure subcommand. πŸ‘‘
  • $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 (see Tk::configure for 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. $widget should be the name of a window already managed by $widget. πŸ’–
    • -before => $widget β€” Insert the window before the window specified. $widget should 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 -height isn'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 by Tk_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 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 containing zero or more of the characters n, s, e or w. 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 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. πŸ“Œ
    • -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 -width isn'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 by Tk_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