How to create a popup window
Hi everybody,
I would like to know the command to create a popup window like in the attached file:
I know that the window will appear by usage of command:
tk_messageBox -message 'some message' -type yesno
But is it possible to define a user specific input and add a image?
Thanks in advance
Answers
-
Hi,
It is possible, you will have to create a GUI with the help of tk.
https://www.tutorialspoint.com/tcl-tk/tk_basic_widgets.htm
You can also refer to HWTK GUI Toolkit available in Start>Programs>Altair Hyperworks 2017>Tools
0 -
thank you for the quick answer and the link! This is the answer to my questions and I'll try to build up me dialog box!
Many thanks
0 -
Hi,
which comand do I have to use instead of 'set w [hwtk::demo::getpreviewframe]' to set this variable in HyperMesh?
# HWVERSION_14.0_Feb 5 2016_17:42:29
#Get preview frame
set w [hwtk::demo::getpreviewframe]set input [hwtk::inputdialog -initialvalue testing -text testing -inputtype str \
-x [winfo rootx $w] -y [winfo rooty $w]]tk_messageBox -title 'hwtk::inputdialog' -message 'Return value: $Input'
Thanks in advance!
0 -
Hi,
Try:
set w [toplevel .mydialog] instead of 'set w [hwtk::demo::getpreviewframe]I would recommend you to manually create label, entry box and buttons instead of hwtk::inputdialog.
0 -
Altair Forum User said:
Hi,
Try:
set w [toplevel .mydialog] instead of 'set w [hwtk::demo::getpreviewframe]I would recommend you to manually create label, entry box and buttons instead of hwtk::inputdialog.
Hi,
thanks for your answer!
ok what do you mean by manually create instead of hwtk::inputdialoge?
as mentoined before, I would like to build a dialog box like in the picture in my first post...
do you have an example how to do this?
thanks in advance
0 -
-
7 minutes ago, Livil Lyle said:
Hi,
I did a sample for you to get started. Please find the attachment.
Regards,
llyle
Thank you very much!
best regard
0 -
Could you please give me a hint, how to add an image?
Like shown in my first post on the upper right hand side...
thanks in advance
Regards
0815
0 -
-
18 minutes ago, Livil Lyle said:
Thank you very much!
Regards
0 -
Hi,
I created my pop up windows and everthing works fine, if I start them one by one!
In a second step I would like to summarize them in one tcl-file.
Therefore I did something like this:
set question1 [tk_messageBox -message 'Do you want to execute first pop up window?' -type yesno -icon question]
switch -- $question1 {
yes {*evaltclscript 'my_first_popup.tcl' 0
}
no {}
}set question2 [tk_messageBox -message 'Do you want to execute second pop up window?' -type yesno -icon question]
switch -- $question2 {
yes {*evaltclscript 'my_second_popup.tcl' 0
}
no {}
}The issue is, that if I say 'yes' to the first question ($question1 ), the second message box ($question2) appears too...
which command do I have to use if I want the second messagebox to appear after finishing the execution of the first popup.tcl?
Thanks in advance
0 -
Hi @8015,
you will have to tie the *evaltclscript 'my_second_popup.tcl' to a proc which runs after the close of your my_first_popup.tcl. Please see the attachment on how you can do the same.
0 -
Hi,
works perfectly!!!! /emoticons/default_biggrin.png' srcset='/emoticons/biggrin@2x.png 2x' title=':D' width='20' />
Thank you very much for your support!
I love this forum you guys are great!
0