🎉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

How to create a popup window

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

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

 

 

<?xml version="1.0" encoding="UTF-8"?>Q4.png

Find more posts tagged with

Sort by:
1 - 13 of 131
    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    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

    image.png.30f93bf1499255cae4ad4f5a0da70065.png

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

    Livil Lyle

     

    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

     

     

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

    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!

     

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

    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.

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

    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

     

     

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

    Hi,

     

    I did a sample for you to get started. Please find the attachment.

     

    Regards,

    llyle

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User
    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

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

    Livil Lyle,

     

    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

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

    Hi @0815

    You will have to work with frames as in attachment. 

    Regards

    llyle

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User
    18 minutes ago, Livil Lyle said:

    Hi @0815

    You will have to work with frames as in attachment. 

    Regards

    llyle

     

    Thank you very much!

     

    Regards

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

    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

     

     

     

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

    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.

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

    Hi,

     

    works perfectly!!!! :D/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!