iwidgets::scrolledframe(1)

πŸ’– iwidgets::scrolledframe πŸ’–

okay bestie, welcome to the manual page for iwidgets::scrolledframe(1) β€” that's the page you're reading, from the [incr Widgets] manual set. it's a scrollable frame, it's iconic, and by the end of this you're gonna know it like the back of your hand. no cap. 🫢


✨ NAME ✨

iwidgets::scrolledframe β€” create and manipulate scrolled frame widgets. that's it, that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

iwidgets::scrolledframe pathName ?options?

that's the whole thing. path name, then some optional options, and boom, you have a widget. ✨


πŸ¦‹ INHERITANCE πŸ¦‹

ok so this widget is literally descended from royalty, look at this family tree:

itk::Widget  <-  iwidgets::Labeledwidget  <- iwidgets::Scrolledwidget <-
iwidgets::Scrolledframe

main character energy running in the family fr fr. πŸ‘‘


πŸŽ€ STANDARD OPTIONS πŸŽ€

these are the options you get from the standard Tk crew, all 12 of them, and yes you need to know every single one:

  • activeBackground
  • background
  • borderWidth
  • cursor
  • font
  • foreground
  • highlightColor
  • highlightThickness
  • relief
  • selectBackground
  • selectBorderWidth
  • selectForeground
check the "options" manual entry for the tea on all the standard options. iykyk.

πŸ’œ ASSOCIATED OPTIONS πŸ’œ

these three come along for the ride from the scrollbar world:

  • activeRelief
  • elementBorderWidth
  • jumptroughColor
the "scrollbar" manual entry has the deets on these associated options.

🌈 INHERITED OPTIONS 🌈

inherited from the ancestors, as one does:

  • LabelBitmap
  • labelFont
  • labelImage
  • labelMargin
  • labelPos
  • labelText
  • labelVariable
  • sticky
the "labeledwidget" class manual entry explains all the inherited options. go read it, bestie.

πŸ”₯ WIDGET-SPECIFIC OPTIONS πŸ”₯

now THIS is the good part. these are the options that make a scrolledframe a scrolledframe. every single one, in order, no skipping:

  • -height β€” Name: height, Class: Height. sets the height of the scrolled frame widget, in any of the forms that Tk_GetPixels accepts. the default height is 100 pixels. short king. πŸ“
  • -hscrollmode β€” Name: hscrollMode, Class: ScrollMode. picks the display mode for the horizontal scrollbar, and you have three choices: static, dynamic, or none. in static mode the scrollbar is shown at all times. dynamic mode shows it only as required. and none straight up disables the scrollbar display. the default is static. periodt.
  • -sbwidth β€” Name: sbWidth, Class: Width. sets the width of the scrollbar, in any of the forms acceptable to Tk_GetPixels. the default width is 15 pixels. ✨
  • -scrollmargin β€” Name: scrollMargin, Class: Margin. the distance between the frame and the scrollbar, in any of the forms acceptable to Tk_GetPixels. the default is 3 pixels. personal space matters. 🫢
  • -vscrollmode β€” Name: vscrollMode, Class: ScrollMode. same deal as the horizontal one but for the vertical scrollbar: static, dynamic, or none. static means the scroll bar is displayed at all times, dynamic means it shows up as required, and none disables the scroll bar display entirely. the default is static. πŸ’…
  • -width β€” Name: width, Class: Width. sets the width of the scrolled frame widget, in any of the forms acceptable to Tk_GetPixels. and the page says, quote unquote, the default height is 100 pixels. yeah girl, it says height. we're just reporting what the manpage says. 😭

πŸ’– DESCRIPTION πŸ’–

so here's the whole concept, bestie: scrolledframe combines the functionallity of scrolling with that of a typical frame widget, and together they implement a clipable viewing area whose visible region may be modified with the scroll bars. the way that lets you build visually larger areas than which could normally be displayed β€” and those areas can hold a heterogenous mix of other widgets. so you're not just scrolling text, you're scrolling a whole situation. πŸ¦‹

and options exist which allow full control over which scrollbars are displayed, and the method β€” i.e. statically or dynamically. the frame itself may be accessed by the childsite method, and then filled with other widget combinations. that's the whole hack and it slays. πŸ”₯


πŸ‘‘ METHODS πŸ‘‘

the iwidgets::scrolledframe command creates a new Tcl command whose name is pathName. this command may be used to invoke various operations on the widget. it has the following general form:

pathName option ?arg arg ...?

Option and the args determine the exact behavior of the command. the following commands are possible for scrolledframe widgets:


🌟 ASSOCIATED METHODS 🌟

  • xview
  • yview
see the "canvas" manual entry for details on the associated methods.

πŸ“ WIDGET-SPECIFIC METHODS πŸ“

  • 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::scrolledframe command.
  • pathName childsite β€” returns the path name of the child site. this is THE method, the one you use to actually put stuff in there. iconic. πŸ’–
  • 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 β€” and 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::scrolledframe command. it does everything. she's versatile. πŸ’…
  • pathName justify direction β€” justifies the frame contents via the scroll bars in one of four directions: left, right, top, or bottom. pick a lane, bestie. 🧚

🌸 COMPONENTS 🌸

every scrolledframe comes with two little sidekicks:

  • horizsb β€” Class: Scrollbar. the horizsb component is the horizontal scroll bar. see the "ScrollBar" widget manual entry for details on the horizsb component item.
  • vertsb β€” Class: Scrollbar. the vertsb component is the vertical scroll bar. see the "ScrollBar" widget manual entry for details on the vertsb component item.

two queens, one frame. πŸ‘‘


⭐ EXAMPLE ⭐

here's the demo, copied exactly as it lives in the page, character for character, don't @ me about the line breaks:

package require Iwidgets 4.0 iwidgets::scrolledframe .sf -width 150
-height 180 \
  -labelon yes -labeltext scrolledframe

set cs [.sf childsite] pack [button $cs.b1 -text Hello] -pady 10 pack
[button $cs.b2 -text World] -pady 10 pack [button $cs.b3 -text "This is
a test"] -pady 10 pack [button $cs.b4 -text "This is a really big
button"] -pady 10 pack [button $cs.b5 -text "This is another really big
button"] -pady 10 pack [button $cs.b6 -text "This is the last really big
button"] -pady 10

pack .sf -expand yes -fill both -padx 10 -pady 10

six buttons in a scrollable child site. that's the whole slay. ✨


πŸ’œ AUTHOR πŸ’œ

  • Mark L. Ulferts
  • Sue Yockey

legends, both of them. thank you for your service. 🫢


πŸŽ€ KEYWORDS πŸŽ€

scrolledframe, frame, widget β€” that's the search terms, bestie, use them wisely. πŸ”


okay that's the whole page, we ate and left no crumbs πŸ’…βœ¨. this came to you from the Tk corner of the world β€” iwidgets::scrolledframe(1), and yes, it is literally that girl. go build something gorgeous with it, bestie. πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from