Tk_MapWindow(3tk)
β¨ 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
tkwinis a child window (i.e.Tk_CreateWindowwas 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
tkwinis 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 proceduresXMapWindowandXUnmapWindow, because these ones update Tk's local data structure fortkwin. Applications using Tk should not invokeXMapWindowandXUnmapWindowdirectly. 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
- debian trixie: tk9.0-doc 9.0.1-3
- ubuntu questing: tk9.0-doc 9.0.2-1
- ubuntu resolute: tk9.0-doc 9.0.3-1
- ubuntu stonking: tk9.0-doc 9.0.4-1
- Copyright (c) 1990 The Regents of the University of California
- Copyright (c) 1994-1997 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms