Forum

Author Topic: Boolean window  (Read 3150 times)

giancan

  • Newbie
  • *
  • Posts: 19
    • View Profile
Boolean window
« on: November 27, 2014, 07:28:47 PM »
Hi!
I know about the possibility in the internal python to get input values from user with
Code: [Select]
PhotoScan.app.getString("Input")
Is there a way to have a similar window with boolean values buttons? Such as Yes/No (and perhaps cancel)?
If so, how and how can I use the selected output?
Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14855
    • View Profile
Re: Boolean window
« Reply #1 on: December 22, 2014, 05:11:50 PM »
Hello giancan,

I think you can use the following sample as a reference for your code:
Code: [Select]
import PhotoScan
from PySide import QtCore, QtGui


app = QtGui.QApplication.instance()
parent = app.activeWindow()

msg = "Are you sure you want to continue?"
reply = QtGui.QMessageBox.question(parent, 'Message', msg, QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)

if reply == QtGui.QMessageBox.Yes:
print("yes")
else:
print("no")
Best regards,
Alexey Pasumansky,
Agisoft LLC