2 ms·
tightly packed portable version of this code -------------------------------------------------------- #!/usr/bin/env bash cat <<EOF | /usr/local/bin/wish pa
by julie1 11y ago
tightly packed portable version of this code
--------------------------------------------------------
#!/usr/bin/env bash
cat <<EOF | /usr/local/bin/wish
package require Tk
pack [button .b -text {Push Me} -command {
tk_messageBox -message {hello, world}
}]
EOF
--------------------------------------------------------
Of course doing it directly in Tk Tcl would be even more portable, readable, simple and smarter and easier to deploy/maintain.
And at the opposite of gtk team tk team does not breaks API for the pleasure of being more right than the users.
So it would be a win-win-win situation to use Tk/Tcl instead of gtk3.
- tcler 11y agoYou can simplify it by starting your program like this: #!/bin/sh # \ exec wish "$0" ${1+"$@"} ( You wouldn't need the cat pipe. )