PDA

View Full Version : Changing label of confirmation button from "OK" to "Next"?


bernie
11-03-2017, 09:59 AM
Is there any way to change the label on the confirmation button when using a vizinput.choose() and vizinput.message() from the default "OK" to something different, such as "Next"?
We might need that to get approval for using this code in a specific application environment...
Thanks!

bernie
11-07-2017, 03:21 PM
any feedback from Worldviz please? Even a simple "yes" or "no" would be useful. thanks in advance!
Bernhard

Jeff
11-08-2017, 07:20 AM
It's not possible to modify the vizinput dialogs but you could try using vizdlg components (http://docs.worldviz.com/vizard/#Vizdlg_dialog_components.htm) instead. With vizdlg, the button labels can be changed. Here's an example:

import viz
import vizdlg
import viztask

viz.go()

# Function to validate value entered in InputDialog
def checkLength(data):

if len(data.value) != 6:
data.error = 'Incorrect length, try again'
return False
else:
return True

# Create an InputDialog object and position it on the screen
dialog = vizdlg.InputDialog(prompt='Enter a value with 6 characters', validate=checkLength, accept='Next', cancel=None)
dialog.setScreenAlignment(viz.ALIGN_CENTER)

def showdialog():
while True:

dialog.value = ''
yield dialog.show()

if dialog.accepted:
print 'accepted',dialog.value
else:
print 'cancelled'

yield viztask.waitTime(1)

viztask.schedule(showdialog())