Tk_AddOption(3tk)

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

πŸ’– NAME πŸ’–

Tk_AddOption β€” bestie, this is the one that drops a whole new option into the option database. Slay.


✨ SYNOPSIS ✨

#include <tk.h>

void
Tk_AddOption(tkwin, name, value, priority)

Tcl_Obj *
Tk_GetSystemDefault(tkwin, dbName, className)

πŸŽ€ ARGUMENTS πŸŽ€

  • Tk_Window tkwin (in) β€” the token for your window, the little ID card that says "this window right here" πŸͺͺ
  • const char *name (in) β€” the multi-element name of the option. yes bestie, multi-element, it's giving whole address 🏑
  • const char *value (in) β€” the value of the option. the actual tea β˜•
  • const char *dbName (in) β€” the option database name πŸ“›
  • const char *className (in) β€” the name of the option class 🏷️
  • int priority (in) β€” the overall priority level to use for this option. this is the ✨hierarchy✨ of who wins

πŸ¦‹ DESCRIPTION πŸ¦‹

So. You call Tk_AddOption when you wanna add an option to the database that's chillin' with tkwin's main window. πŸ’…

name is the option you're specifying, and it's made up of names and/or classes separated by asterisks or dots β€” you know, the usual X format, iykyk. value is the text string you're tying to that name, and that exact string is what comes back at you in calls to Tk_GetOption. πŸ”

Now priority? That's the vibe check. It says how important this value is, and when options get queried with Tk_GetOption, the value with the highest priority is the one that gets returned. periodt. πŸ‘‘

⚠️ Real talk though: priority must be between 0 and TK_MAX_PRIO (100). No going over, no going under, bestie.

Some common priority values you'll see in the wild, no cap:

  • TK_WIDGET_DEFAULT_PRIO β€” used for default values hard-coded into widgets 🧸
  • TK_STARTUP_FILE_PRIO β€” used for options specified in application-specific startup files πŸ“‚
  • TK_USER_DEFAULT_PRIO β€” used for options specified in user-specific defaults files, like .Xdefaults, resource databases loaded into the X server, or user-specific startup files πŸ™‹β™€οΈ
  • TK_INTERACTIVE_PRIO β€” used for options specified interactively after the application starts running. main character energy, honestly 🎬

Tk_GetSystemDefault is the little sibling function and she eats, fr fr β€” she returns a Tcl_Obj * holding the string that identifies a configuration option matching the given dbname and className. And if there are no system defaults matching that pair? She hands you back NULL. 😭 empty-handed, it's giving nothing.


πŸ”‘ KEYWORDS πŸ”‘

class, name, option, add


okay that's the whole page bestie, you're officially fluent πŸ’–βœ¨

This one's straight outta the Tk library procedures β€” Tk_AddOption(3tk), the manual page itself, no extra version number or date to spill, just the Tk source it lives in. go forth and add some options, you gorgeous genius 🫢🌸

πŸ“¦ where this page comes from