🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Closing of a

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hey guys,

 

I created a .tcl-script which opens a window where I can put in a reference temperature. After the value is entered, I would like the window to be closed automatically and hence to exit the program.

I can't find any commands (like an exit-command) that work the way I want them to. Can you help me out on this topic?

 

Kind regards,

Simon

 

Attached you can find the script:

Unable to find an attachment - read this blog

Find more posts tagged with

Sort by:
1 - 5 of 51
    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    Hi,

     

    In your code,

     

     destroy .window11

     

    will close the window. Not sure how to close it as soon as you enter a value. 

    User: "tinh"
    Altair Community Member
    Updated by tinh
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hey guys,

    thank you both for your quick replies.

     

    There's still a problem left. After entering the value for the first time and closing the window, I open the same window again by clicking on my button. The value I entered the first time seems to be stored somehow, because it's still appearing on the screen.

    Do you know how I can delete the value and clear the window?

     

    Kind regards,

    Simon

    User: "tinh"
    Altair Community Member
    Updated by tinh

    If you use an entry widget, clear its content by

    $e delete 0 end

     

    Or set value of its text variable as ''

    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    In current program you can use

     

     catch {unset ref_temp} 

     

    in the beginning.