update src/add_custom_button.tcl to match code refactoring done in r2264

This commit is contained in:
stefan schippers 2023-03-29 23:41:28 +02:00
parent 63d4c55a09
commit d0d31a87c8
2 changed files with 3 additions and 6 deletions

View File

@ -445,11 +445,8 @@ void ask_new_file(void)
my_snprintf(msg, S(msg),
"tk_messageBox -type okcancel -icon warning -parent [xschem get topwindow] "
"-message {Warning: %s already open.}", f);
if(has_x) {
tcleval(msg);
if(strcmp(tclresult(), "ok")) skip = 1;
}
else dbg(0, "ask_new_file: %s already open: %s\n", f, win_path);
tcleval(msg);
if(strcmp(tclresult(), "ok")) skip = 1;
}
if(!skip) {
dbg(1, "ask_new_file(): load file: %s\n", f);

View File

@ -36,7 +36,7 @@ imgMyButton put $MyButtonData
## Create the toolbar button
## constructor name tcl command tooltip topwindow
toolbar_create MyButton { puts SMILE! } "SMILE!" {}
toolbar_add MyButton { puts SMILE! } "SMILE!" {}
## Destroy and rebuild the toolbar, but see better option here under ...
# toolbar_hide