Frame(3pm)

πŸ’– Tk::Frame β€” Create and manipulate Frame widgets πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation section, and today's main character is Frame (the 3pm kind, aka a Perl module manpage, iykyk). she's simple, she's iconic, she's literally just a box. let's get into it πŸŽ€


✨ SYNOPSIS ✨

$frame = $parent->Frame(?options?);

that's it. that's the whole vibe. you call Frame on a parent and you get a frame back. slay πŸ’…


🫢 STANDARD OPTIONS 🫢

these are the standard ones she inherited, no notes:

  • -borderwidth
  • -class
  • -highlightbackground
  • -highlightcolor
  • -highlightthickness
  • -relief
  • -takefocus
  • -cursor
heads up bestie: go read Tk::options for the deets on all of these standard options, they're not re-explained here. πŸ’œ

🌸 WIDGET-SPECIFIC OPTIONS 🌸

these are the ones that are hers, the little personality traits, if you will:

  • -background β€” Name: background, Class: Background. okay so this is the same as the standard background option, EXCEPT her value can also be an undefined value. and if it is undefined?? the widget shows no background or border at all, and consumes no colors from its colormap for its background and border. minimalism, she invented it ✨
  • -colormap β€” Name: colormap, Class: Colormap. specifies a colormap to use for the window. the value can be either new β€” in which case a brand new colormap gets created for the window and its children β€” or the name of another window (which must be on the same screen and have the same visual as $widget), in which case the new window uses the colormap from that specified window. if you don't specify the colormap option, the new window just uses the same colormap as its parent. πŸ’€ you may NOT change this one with the configure method. it's set in stone fr fr.
  • -container β€” Name: container, Class: Container. the value must be a boolean. if it's true, that means this window is gonna be used as a container that some other application gets embedded into (for example, a Tk toplevel can be embedded using the -use option). the window will support the appropriate window manager protocols for stuff like geometry requests. and here's the thing β€” the window should not have any children of its own in this application. also, nope, this option may not be changed with the configure method. periodt.
  • -height β€” Name: height, Class: Height. specifies the desired height for the window, in any of the forms acceptable to Tk_GetPixels. if this option is less than or equal to zero, the window won't request any size at all. zero thoughts, head empty πŸ¦‹
  • -visual β€” Name: visual, Class: Visual. specifies visual information for the new window, in any of the forms accepted by Tk_GetVisual. if you don't specify it, the new window uses the same visual as its parent. and again β€” the visual option may not be modified with the configure method. no touchy πŸ™ˆ
  • -width β€” Name: width, Class: Width. specifies the desired width for the window, in any of the forms acceptable to Tk_GetPixels. if this option is less than or equal to zero, the window won't request any size at all. same energy as height, honestly πŸ’…

🌈 DESCRIPTION 🌈

okay so the Frame method creates a new window (given by the $widget argument) and makes it into a frame widget. additional options, described above, may be specified on the command line or in the option database, and they configure aspects of the frame like its background color and relief. the frame command returns the path name of the new window. πŸŽ€

a frame is a simple widget. like, genuinely simple. her primary purpose in life is to act as a spacer or a container for complex window layouts. that's the job. the only features of a frame are her background color and an optional 3-D border to make the frame appear raised or sunken. that's it!! she's the lowkey backbone of every layout and she doesn't even brag about it. main character energy but make it humble πŸ‘‘


πŸ’… WIDGET METHODS πŸ’…

the Frame method creates a widget object. this object supports the configure and cget methods described in Tk::options, which you can use to enquire about and modify the options described above. the widget also inherits all the methods provided by the generic Tk::Widget class. so she's not just a box, she's a box with a whole family tree. 🫢


πŸ”₯ BINDINGS πŸ”₯

when a new frame is created, it has no default event bindings: frames are not intended to be interactive. she's not here to be clicked, she's here to hold space. literally. πŸ’€


⭐ KEYWORDS ⭐

frame, widget


and that's the whole page bestie, you ate that πŸ’–βœ¨

cute little sign-off: this page ships with perl v5.40.1 and was dated 2025-04-13. go build something gorgeous with your little boxes πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from