Tk_MapWindow(3tk)

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

✨ NAME ✨

Tk_MapWindow, Tk_UnmapWindow β€” the iconic duo that maps or unmaps a window πŸ’–


🌸 SYNOPSIS 🌸

#include <tk.h>

Tk_Window
Tk_MapWindow(tkwin)

Tk_UnmapWindow(tkwin)

πŸŽ€ ARGUMENTS πŸŽ€

  • Tk_Window tkwin (in) β€” your token for the window, bestie. that's the whole vibe right there.

πŸ’… DESCRIPTION πŸ’…

okay so these two procedures are how you map and unmap windows that Tk is managing. no cap.

Tk_MapWindow maps the window given by tkwin, and β€” this is the part people forget β€” it also creates the X window corresponding to tkwin if it doesn't already exist. like, if it's not there yet, it gets made. lowkey magic ✨ If you wanna know more about that whole deferred window creation situation, go read the Tk_CreateWindow manual entry, she explains it better than I ever could.

Tk_UnmapWindow does the opposite: it unmaps tkwin's window from the screen. bye bestie πŸ‘‹

Now, here's the timing tea β˜• β€” it depends on what kind of window tkwin is:

  • If tkwin is a child window (i.e. Tk_CreateWindow was used to create a child window), then event handlers that are interested in map and unmap events get invoked immediately. right now. instant. no waiting. 🫢
  • If tkwin is not an internal window, then those event handlers get invoked later, after X has seen the request and returned an event for it. so like… eventually. X has to do her thing first. πŸ™ˆ
⚠️ IMPORTANT ONE, FR FR: use these procedures instead of the X procedures XMapWindow and XUnmapWindow, because these ones update Tk's local data structure for tkwin. Applications using Tk should not invoke XMapWindow and XUnmapWindow directly. like, just don't. it's giving chaos and we're not doing that. πŸ’€

πŸ‘‘ KEYWORDS πŸ‘‘

map, unmap, window


and that's the whole page, babe πŸ’œ this one came to you from the Tk library and the Tk_MapWindow(3tk) girlies β€” go map a window, slay, periodt πŸ¦‹βœ¨

πŸ“¦ where this page comes from