destroy(n)

πŸ“¦
version 9.0.3 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

destroy(n) β€” Tk Built-In Commands πŸ’…

okay so this is a Tk Built-In Commands page, and it's literally about deleting windows. bestie, it's the cleanup arc and it ate β€” no cap πŸ’–

🌸 NAME 🌸

destroy β€” Destroy one or more windows

✨ SYNOPSIS ✨

destroy ?window window ...?

πŸ¦‹ DESCRIPTION πŸ¦‹

so destroy deletes the windows you give it as the window arguments, plus all of their descendants β€” the whole window family tree, no survivors, periodt 😭.

If the window . is deleted, then all windows will be destroyed and the application will (normally) exit. that's iconic for cleanup and also your app is leaving the chat πŸ’€.

The windows are destroyed in order. If an error occurs while destroying a window, the command aborts right there and does not destroy the remaining windows. And if a window does not exist? No error is returned β€” it's lowkey fine 🫢.

πŸŽ€ EXAMPLE πŸŽ€

Destroy all checkbuttons that are direct children of the given widget:

proc killCheckbuttonChildren {parent} {
   foreach w [winfo children $parent] {
      if {[winfo class $w] eq "Checkbutton"} {
         destroy $w
      }
   }
}

πŸ‘‘ KEYWORDS πŸ‘‘

  • application
  • destroy
  • window

sign-off bestie: source/version is Tk, page is destroy(n), and the footer has no date listed β€” so no invented date, just vibes βœ¨πŸ’–πŸ«Ά

πŸ“¦ where this page comes from