Tk_GetPixmap(3tk)
π NAME π
Tk_GetPixmap, Tk_FreePixmap β bestie, this is how you allocate and free pixmaps. That's the whole job. No cap. β¨
πΈ SYNOPSIS πΈ
#include <tk.h>
Pixmap
Tk_GetPixmap(display, d, width, height, depth)
Tk_FreePixmap(display, pixmap)
π ARGUMENTS π
Display *display(in) β the X display the pixmap lives on. Like, which screen are we doing this on, girl. πDrawable d(in) β a pixmap or a window where your brand-new pixmap is gonna be used for drawing. It's giving "where am I gonna sit."int width(in) β width of the pixmap. How wide. Periodt.int height(in) β height of the pixmap. How tall. Yes bestie, dimensions matter. πint depth(in) β number of bits per pixel in the pixmap. The bit depth. So many bits. π¦Pixmap pixmap(in) β the pixmap to destroy. Say bye π
β¨ DESCRIPTION β¨
Okay so here's the tea π« β these procedures are identical to the Xlib procedures XCreatePixmap and XFreePixmap, except they've got extra code that manages X resource identifiers, so identifiers from deleted pixmaps can be reused later. That's the upgrade, that's the glow-up, that's the whole point.
β οΈ And this part is important, bestie: Tk applications really need to use these procedures instead ofXCreatePixmapandXFreePixmap. Why? Because otherwise long-running applications may run out of resource identifiers. π Like, they just run dry. Not cute. Do not do that.
Tk_GetPixmap creates a pixmap that's suitable for drawing in d, with dimensions given by width, height, and depth, and it returns its identifier. Boom. β¨
Tk_FreePixmap destroys the pixmap given by pixmap and makes its resource identifier available for reuse. Recycling queen β»οΈπ
π KEYWORDS π
pixmap, resource identifier
Okay that's the whole page, you ate that fr fr π This was the Tk Library Procedures page, living in the Tk 4.0 era, and yeah β it's literally titled Tk_GetPixmap(3tk) and we're gonna say it one more time just because: Tk_GetPixmap(3tk). Slay. β¨ππ¦
π¦ 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-1996 Sun Microsystems, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms