Tk_MainWindow(3)

Tk_MainWindow(3) πŸ’…

okay so this page is from Tk Library Procedures, and it's all about main-window info, bestie. No cap, the group chat here includes Tk_MainWindow, Tk_GetNumMainWindows, Tk_SetMainMenubar, and Tk_SetWindowMenubar. 🫢


NAME πŸ¦‹

Tk_MainWindow, Tk_GetNumMainWindows β€” functions for querying main window information. The synopsis also pulls in Tk_SetMainMenubar and Tk_SetWindowMenubar, iykyk. ✨


SYNOPSIS 🌸

#include <tk.h>

Tk_Window
Tk_MainWindow(interp)

Tk_SetMainMenubar(interp, tkwin, menuName)

Tk_SetWindowMenubar(interp, tkwin, oldMenuName, menuName)

int
Tk_GetNumMainWindows()

ARGUMENTS πŸŽ€

  • Tcl_Interp *interp (in/out) β€” the interpreter associated with the application. πŸ’–
  • Tk_Window tkwin (in) β€” token for main window. πŸͺŸ
  • const char (*menuName) β€” the name of the new menubar that the toplevel needs to be set to. NULL means there is no menu right now. πŸ“
  • const char (*oldMenuName) β€” the name of the menubar previously set in this toplevel. NULL means no menu was set previously. 🧚

DESCRIPTION πŸ’œ

A main window is a special kind of toplevel window used as the outermost window in an application. Literally main character energy. πŸ‘‘

If interp is associated with a Tk application, then Tk_MainWindow returns the application's main window. If there is no Tk application associated with interp, then Tk_MainWindow returns NULL and leaves an error message in interpreter interp's result. 😭

Tk_GetNumMainWindows returns a count of the number of main windows currently open in the current thread. Bestie, it's a headcount for main windows. πŸ”₯

Tk_SetMainMenubar is called when a toplevel widget is brought to front. On the Macintosh, it sets up the menubar that goes across the top of the main monitor. On other platforms, nothing is necessary. πŸ’…

Tk_SetWindowMenubar associates a menu with a window. The old menu clones for the menubar are thrown away, and a handler is set up to allocate the new ones. The way that old stuff gets yeeted? Iconic. ✨


KEYWORDS ⭐

  • application
  • main window

later, bestie πŸ’– footer tea: source/version is Tk 7.0, page is Tk_MainWindow(3), and the date slot is not showing a date on this page β€” periodt. πŸŽ€

πŸ“¦ where this page comes from