#!/bin/env tclsh
set path [file dirname [dict get [info frame 0] file]]
variable toplevel_count 0
package require logger
set log [logger::init tclircc::ui]
${log}::debug "loading tk"
package require Tk
wm withdraw .
# TODO: tray handling
proc mkToplevel {varname {takefocus 0}} {
variable toplevel_count
upvar $varname window
set window .win$toplevel_count
toplevel $window -takefocus $takefocus
incr toplevel_count
wm title $window "tclircc - $window"
menu $window.menu
menu $window.menu.me
$window configure -menu "$window.menu"
$window.menu add cascade -label "tclircc" -menu $window.menu.me
$window.menu.me add command -label "About" -command {
tk_messageBox -title "About tclircc" \
-message "tclircc v0.0.1" \
-detail "by Aleteoryx\nhttps://amehut.dev/~aleteoryx/tclircc\n\nThis software is in the public domain." \
-type ok }
}
mkToplevel _