Hi,
I have a simple Tcl/Tk script which I would like to start by double clicking it instead of calling it from the command line. How to get my script started that way?
Tried with chmod +x, but a dialog pops up and asks me how to run this script: in terminal, display or run. What I would like is to go straight to execution, without any dialog boxes. How to go about?
To tell it how to run the script the first line needs to be #! followed by the path to the interpreter. If you're using Linux you can use /usr/bin/wish for a tcl/tk gui. Like this:
But I need the window. When I substitute wish for tclsh in the shebang line, I get error message (only when I run the script in console):
invalid command name "button"
while executing
"button .someButton -text etc -command {some-tcl-command}"
I need the window, the buttons, etc. And I made the windowed script executable with chmod +x. But I don't need the "Run or Display?" dialog box, is there any way around it?
Ok, got it. It doesn't have to do anything with tclsh vs. wish or making executable, linking, wrapping in C executable, changing MIME types etc.
I selected the file in the file browser and then selected "Edit" -> Preferences -> Behavior -> to the section "executable text files" where the radio button "Run when they are clicked" needs to be checked and that's about it...
Thanks to all that tried to help
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.