ttk::sizegrip(n)
π ttk::sizegrip(n) π
okay so bestie, this is a page from the Tk Themed Widget manual set β the ttk::sizegrip page, to be exact. sit down, grab a strawberry drink π, and let's get into it.
β¨ NAME β¨
ttk::sizegrip β the bottom-right corner resize widget, aka the little grabby thing that lets you stretch a window π
β¨ SYNOPSIS β¨
ttk::sizegrip pathName ?options?
β¨ DESCRIPTION β¨
A ttk::sizegrip widget β also known as a grow box, iconic name honestly β lets the user resize the toplevel window that contains it by pressing and dragging the grip. That's it. That's the whole vibe. press, drag, window gets bigger. π«Ά
β¨ STANDARD OPTIONS β¨
-class-cursor-style-takefocus
no cap, for the full deets on these, go check the ttk_widget manual entry β it's the source of truth π
β¨ WIDGET COMMAND β¨
Sizegrip widgets support the standard commands, and yes these are literally the names, keep them exact:
cgetconfigureidentify elementinstatestatestyle
(see ttk::widget for all of those, iykyk β¨)
β¨ PLATFORM-SPECIFIC NOTES β¨
On macOS, toplevel windows automatically include a built-in size grip by default. So adding a ttk::sizegrip there is harmless β the built-in grip just masks the widget. like, it's fine, nobody's mad, the built-in one is just standing in front of yours π
β¨ EXAMPLES β¨
Using pack β the classic:
pack [ttk::frame $top.statusbar] -side bottom -fill x
pack [ttk::sizegrip $top.statusbar.grip] -side right -anchor se
Using grid β for the layout girlies:
grid [ttk::sizegrip $top.statusbar.grip] \
-row $lastRow -column $lastColumn -sticky se
# ... optional: add vertical scrollbar in $lastColumn,
# ... optional: add horizontal scrollbar in $lastRow
β¨ BUGS β¨
okay listen, two things, and they're both real π
- If the containing toplevel's position was specified relative to the right or bottom of the screen (e.g.,
wm geometry ... wxh-x-yinstead ofwm geometry ... wxh+x+y), the sizegrip widget will not resize the window. fr fr, it just won't. ttk::sizegripwidgets only support "southeast" resizing. that's the whole range of motion, bestie. one corner. periodt.
β¨ STYLING OPTIONS β¨
The class name for a ttk::sizegrip is TSizegrip π
TSizegrip styling options configurable with ttk::style are:
-background color
Some options are only available for specific themes β so don't come for me if yours is missing something, check your theme first π
See the ttk::style manual page for the tea on how to configure ttk styles.
β¨ SEE ALSO β¨
ttk::widget(n)
β¨ KEYWORDS β¨
- widget
- sizegrip
- grow box
and that's the page!! mwah π this was brought to you by Tk version 8.5 and the ttk::sizegrip(n) corner of the manual β go forth and resize responsibly, bestie ππ
π¦ where this page comes from
- alpine 3.23: tk9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tk9-doc 9.0.3-r2 Β· TCL
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 43: tk 1:9.0.2-1.fc43 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- fedora 44: tk 1:9.0.2-1.fc44 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- nixos 26.05: tk 9.0.3
- nixpkgs unstable: tk 9.1.0
- Copyright (c) 2006 Joe English
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms