iwidgets::panedwindow(1)

✨ iwidgets::panedwindow β€” the [incr Widgets] manual, but make it make sense ✨

okay bestie, welcome to the panedwindow page πŸ’– this is from the [incr Widgets] corner of the Tk manual and it's genuinely iconic once you get it. sit down, grab a snack πŸ“


🌸 NAME 🌸

iwidgets::panedwindow β€” create and manipulate a paned window widget. that's the whole vibe. no cap.


πŸŽ€ SYNOPSIS πŸŽ€

iwidgets::panedwindow pathName ?options?

πŸ¦‹ INHERITANCE πŸ¦‹

itk::Widget <- iwidgets::Panedwindow

it's giving legacy. it's giving itk royalty. πŸ‘‘


⭐ STANDARD OPTIONS ⭐

  • background
  • cursor

if you want the whole tea on those, go read the "options" manual entry, it's all there fr fr.


πŸ’… WIDGET-SPECIFIC OPTIONS πŸ’…

okay this is the good part, the options that are hers specifically.

  • Name: height β€” Class: Height β€” Command-Line Switch: -height

specifies the overall height of the paned window, in any of the forms acceptable to Tk_GetPixels. the default is 10 pixels.

  • Name: orient β€” Class: Orient β€” Command-Line Switch: -orient

specifies the orientation of the separators: vertical or horizontal. the default is horizontal.

  • Name: sashBorderWidth β€” Class: BorderWidth β€” Command-Line Switch: -sashborderwidth

specifies a value indicating the width of the 3-D border to draw around the outside of the sash, in any of the forms acceptable to Tk_GetPixels. the default is 2 pixels.

  • Name: sashCursor β€” Class: Cursor β€” Command-Line Switch: -sashcursor

specifies the type of cursor to be displayed in the sash. the default is crosshair.

  • Name: sashHeight β€” Class: Height β€” Command-Line Switch: -sashheight

specifies the height of the sash, in any of the forms acceptable to Tk_GetPixels. the default is 10 pixels.

  • Name: sashIndent β€” Class: SashIndent β€” Command-Line Switch sashindent

specifies the placement of the sash along the panes, in any of the forms acceptable to Tk_GetPixels. a positive value causes the sash to be offset from the near (left/top) side of the pane, and a negative value causes the sash to be offset from the far (right/bottom) side. if the offset is greater than the width, then the sash is placed flush against the side. the default is -10 pixels.

heads up: yes, that command-line switch is written sashindent with no leading dash up there. that's just how it's listed, don't @ me πŸ’€
  • Name: sashWidth β€” Class: Width β€” Command-Line Switch: -sashwidth

specifies the width of the sash, in any of the forms acceptable to Tk_GetPixels. the default is 10 pixels.

  • Name: showHandle β€” Class: ShowHandle β€” Command-Line Switch: -showhandle

specifies whether or not to display the sashes on the window panes. the default is 1, and valid options are 0 and 1.

  • Name: thickness β€” Class: Thickness β€” Command-Line Switch: -thickness

specifies the thickness of the separators, in any of the forms acceptable to Tk_GetPixels. the default is 3 pixels.

  • Name: width β€” Class: Width β€” Command-Line Switch: -width

specifies the overall width of the paned window, in any of the forms acceptable to Tk_GetPixels. the default is 10 pixels.


πŸ’œ DESCRIPTION πŸ’œ

the iwidgets::panedwindow command creates a multiple paned window widget that can orient its panes either vertically or horizontally. every pane is itself a frame, acting as a child site for other widgets. and the border separating each pane? it contains a sash which lets the user position the panes relative to one another. it's giving flexible layout main character energy 🫢


🌈 METHODS 🌈

the iwidgets::panedwindow command creates a new Tcl command whose name is pathName. you use that command to invoke various operations on the widget. the general form is:

pathName option ?arg arg ...?

option and the args decide the exact behavior of the command. slay.

a lot of the widget commands for the panedwindow take an argument that's an indicator of which pane of the paned window to operate on. these indicators are called indexes, and they let you reference and manipulate panes no matter what their current map state is. paned window indexes can be specified in any of these forms:

  • number β€” specifies the pane numerically, where 0 corresponds to the nearest (top/left-most) pane of the paned window.
  • end β€” indicates the farthest (bottom/right-most) pane of the paned window.
  • pattern β€” if the index doesn't satisfy one of the above forms then this form is used. pattern is pattern-matched against the tag of each pane in the panedwindow, in order from left/top to right/left, until a matching entry is found. the rules of Tcl_StringMatch are used.

πŸ‘‘ WIDGET-SPECIFIC METHODS πŸ‘‘

  • pathName add tag ?option value option value?

adds a new pane to the paned window on the far side (right/bottom). the following options may be specified:

  • -margin value β€” specifies the border distance between the pane and pane contents, in any of the forms acceptable to Tk_GetPixels. the default is 8 pixels.
  • -minimum value β€” specifies the minimum size that a pane's contents may reach, not inclusive of twice the margin, in any of the forms acceptable to Tk_GetPixels. the default is 10 pixels.

the add method returns the path name of the pane.

  • pathName cget option

returns the current value of the configuration option given by option. option may have any of the values accepted by the iwidgets::panedwindow command.

  • pathName childsite ?index?

returns a list of the child site path names, or a specific child site given an index. the list is constructed from the near side (left/top) to the far side (right/bottom).

  • pathName configure ?option? ?value option value ...?

query or modify the configuration options of the widget. if no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). if option 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. option may have any of the values accepted by the iwidgets::panedwindow command.

  • pathName delete index

deletes a specified pane given an index.

  • pathName fraction percentage percentage ?percentage percentage ...?

sets the visible percentage of the panes. specifies a set of percentages which are applied to the visible panes from the near side (left/top). the number of percentages must be equal to the current number of visible (mapped) panes and add up to 100. math girlies rise πŸ”₯

  • pathName hide index

changes the visiblity of the specified pane, allowing a previously displayed pane to be visually removed rather than deleted.

  • pathName index index

returns the numerical index corresponding to index.

  • pathName insert index tag ?option value option value ...?

same as the add command except that it inserts the new pane just before the one given by index, instead of appending to the end of the panedwindow. the option and value arguments have the same interpretation as for the add widget command.

  • pathName paneconfigure index ?options?

this command is similar to the configure command, except that it applies to the options for an individual pane, whereas configure applies to the options for the paned window as a whole. options may have any of the values accepted by the add widget command. if options are specified, options are modified as indicated in the command and the command returns an empty string. if no options are specified, returns a list describing the current options for entry index (see Tk_ConfigureInfo for information on the format of this list).

  • pathName reset

redisplays the pane window using default percentages.

  • pathName show index

changes the visiblity of the specified pane, allowing a previously hidden pane to be displayed.


πŸ™ˆ NOTES πŸ™ˆ

dynamic changing of the margin and or minimum options to values which make the current configuration invalid will block subsequent sash movement until the fractions are modified via the fraction method. for example, a panedwindow is created with three panes and the minimum and margin options are at their default settings. next the user moves the sashes to compact the panes to one side. now, if the minimum is increased on the most compressed pane via the paneconfigure method to a large enough value, then sash movement is blocked until the fractions are adjusted. this situation is unusual and under normal operation of the panedwindow, this problem will never occur. so like. breathe. it's fine 🌸


🧚 EXAMPLE 🧚

package require Iwidgets 4.0
iwidgets::panedwindow .pw -width 300 -height 300
.pw add top
.pw add middle -margin 10
.pw add bottom -margin 10 -minimum 10

pack .pw -fill both -expand yes

foreach pane [.pw childSite] {
   button $pane.b -text $pane -relief raised -borderwidth 2
   pack $pane.b -fill both -expand yes
}

.pw fraction 50 30 20
.pw paneconfigure 0 -minimum 20
.pw paneconfigure bottom -margin 15

copy paste, run it, watch it eat πŸ’…


πŸ’– ACKNOWLEDGEMENTS πŸ’–

shoutout to the OGs, periodt:

  • Jay Schmidgall
    • 1994 - Base logic posted to comp.lang.tcl
  • Joe Hidebrand <hildjj@fuentez.com>
    • 07/25/94 - Posted first multipane version to comp.lang.tcl
    • 07/28/94 - Added support for vertical panes
  • Ken Copeland <ken@hilco.com>
    • 09/28/95 - Smoothed out the sash movement and added squeezable panes.

they really said "let me cook" and cooked 🫢


✨ AUTHOR ✨

Mark L. Ulferts


πŸ”₯ KEYWORDS πŸ”₯

panedwindow, widget


and that's the whole page bestie, you're officially a panedwindow girlie now πŸ’œ this came to you straight from the Tk manual set, filed under iwidgets::panedwindow(1) β€” go build something gorgeous with it, mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from