raise(3tk)

πŸ“¦
version 9.0.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… raise β€” the glow-up your window deserves

okay bestie, so we're talking about raise, a Tk built-in command, and it's literally the "make my window sit on top" button. it changes a window's position in the stacking order. that's it, that's the whole vibe. ✨


πŸŽ€ SYNOPSIS

raise window ?aboveThis?

short, sweet, iconic. two args max, one of them optional. we love a low-maintenance king. πŸ‘‘


🌸 DESCRIPTION

So here's the tea 🍡 β€” there are two whole moods this command can be in.

Mood 1: no aboveThis. If you don't pass aboveThis at all, raise hoists window up so it sits above all of its siblings in the stacking order. Translation: it will not be obscured by any siblings, and it will obscure any siblings that overlap it. it's giving main character energy, it's giving "everyone else is background now". πŸ’…

Mood 2: you passed aboveThis. If aboveThis is specified, it has to be the path name of a window that is either:

  • a sibling of window, or
  • the descendant of a sibling of window.

(no random windows allowed, bestie β€” it's a very specific guest list 🫢)

In that case, raise inserts window into the stacking order just above aboveThis β€” or, more precisely, just above the ancestor of aboveThis that is a sibling of window. and here's the plot twist: this could end up either raising or lowering window. yeah. the command name is a little bit of a liar sometimes. πŸ™ˆ not me calling out the manpage.

important restack lore: all toplevel windows may be restacked with respect to each other, whatever their relative path names are. BUT β€” the window manager is not obligated to strictly honor requests to restack. so you can ask, but the WM might just ignore you. it's giving "seen at 11:47". πŸ’€

macOS moment 🍎 β€” on macOS, raising an iconified toplevel window causes it to be deiconified. so it comes back from the shadow realm, fully un-minimized, slay.


πŸ¦‹ EXAMPLE

the goal: make a button appear to be inside a sibling frame that was actually created after it. this is often necessary when you're building GUIs in that style where you create your activity widgets first, before laying them out on the display. (chaotic, but okay, we support it 🌈)

button .b -text "Hi there!"
pack [frame .f -background blue]
pack [label .f.l1 -text "This is above"]
pack .b -in .f
pack [label .f.l2 -text "This is below"]
raise .b

see how .b was born before .f but ends up chilling inside it? that's the raise magic, no cap. πŸ”₯


πŸ‘‘ SEE ALSO

(its sibling. its nemesis. its other half. go read it too πŸ’œ)


⭐ KEYWORDS

obscure, raise, stacking order


and that's the whole page, bestie β€” written by Tk, version 3.3, dated back in the day, and catalogued under raise(3tk). stan a stacking order. periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from