Announcement

Collapse
No announcement yet.

Question: How to get user input from a popup (like a modal dialog)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question: How to get user input from a popup (like a modal dialog)

    Locutus gave the following example for creating a popup window:
    Code:
    	'Create a popup message at the start of the game'
    	popup = PyPopup.PyPopup()
    	popup.setBodyString( 'Hello World' )
    	popup.launch()
    Now what I would like to do is to be able to pop up a window that would get some input from the user. For now simply having two buttons and returning to the calling code when one of them was clicked (with a way to determine which was clicked) would be enough.

    The example popup returns immediately (ie it's not modal). You can see this if you create two popups and launch both of them in sequence - they will both end up on the screen on top of each other instead of the second one opening when you click ok on the first one.

    Looking at CvPopupInterface.py it looks like maybe the way to handle it instead is by adding callbacks for buttons. Is this the only way to do it? Where would I find more information on the Popup class? I didn't see a Popup.py file anywhere. The only thing I found in the class reference is CyPopup, which has at least some of the same functions, but none of them have any documentation yet.

    Thanks,
    Daniel
Working...
X