🎉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

TCL: GUI/widget needed for two customized buttons

User: "Kruger"
Altair Community Member
Updated by Kruger

Hello -  I am trying to create a macro, but I want to have customized buttons in a pop-up window rather than yes/no.  Here is how I create the yes/no pop-up:

tk_messageBox -title $version -type yesno -message "Ask question here...?"

Do I need a widget instead?

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Brett Ramsey_20633"
    New Altair Community Member
    Accepted Answer
    Updated by Brett Ramsey_20633
    <span class="ph Blue">I would personally always work with dialogs. <br /><br />An example of a dialog with custom button can be seen below. <br /><br />if {[winfo exists .d]} {destroy .d} <br /><br />set dlg [::hwtk::dialog .d -title "Custom Buttons"]<br /><br />set f [.d recess]<br /><br />::hwtk::button $f.b1 -text "Text Here" -help "Text only" -command Button1<br /><br />pack $f.b1<br /><br />$dlg buttonconfigure ok -command onOK<br /><br />proc Button1 {} {<br /><br /> puts "Button 1 Success"<br /><br />}<br />proc onOK {} {<br /><br /> .d unpost<br /> puts "Proceed"<br /> <br />}<br /><br />.d post<br /></span>
    <span class="ph Blue">Dialogs are very flexible and can contain many different types of base widgets. This should do what you are asking to do. <br /><br />Hope this helps <br /></span>