>> The only thing I couldn't immediately figure out from that post, was what to do with widgets that need a parent<br><br>You could use QApplication.activeWindow(), you might get the mainwindow or python dialog. Or you could cycle thru the list of QApplication.topLevelWidgets() to look for the paraview mainwindow.<br>
<br>Pat<br><br><div class="gmail_quote">On Wed, May 26, 2010 at 6:27 PM, <span dir="ltr"><<a href="mailto:m.c.wilkins@massey.ac.nz">m.c.wilkins@massey.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Hi,<br>
<div class="im"><br>
On Wed, May 26, 2010 at 11:18:29AM -0400, pat marion wrote:<br>
> If you want to use PyQt4, see<br>
> <a href="http://paraview.markmail.org/message/6h767kpak5dcoqwt" target="_blank">http://paraview.markmail.org/message/6h767kpak5dcoqwt</a><br>
<br>
</div>Thank you, this is what I needed, good stuff. The only thing I<br>
couldn't immediately figure out from that post, was what to do with<br>
widgets that need a parent, because I couldn't get hold of the main<br>
paraview window widget. Anyway this is what I did:<br>
<br>
---<br>
import PyQt4.QtGui<br>
<br>
# this is a dummy widget to use as the parent for other widgets that need a<br>
parent<br>
wid = PyQt4.QtGui.QWidget()<br>
<br>
# get some user input<br>
ret = PyQt4.QtGui.QInputDialog.getText(wid, 'hi', 'first question')<br>
<br>
# do some other stuff<br>
<br>
# oh dear a warning<br>
ret = PyQt4.QtGui.QMessageBox.warning(wid, 'hi', 'there was a recoverable problem', PyQt4.QtGui.QMessageBox.Ok, PyQt4.QtGui.QMessageBox.NoButton, PyQt4.QtGui.QMessageBox.NoButton)<br>
<br>
# maybe get some more input<br>
ret = PyQt4.QtGui.QInputDialog.getText(wid, 'hi', 'second question')<br>
---<br>
<br>
<br>
Thanks<br>
<br>
Matt<br>
<br>
<br>
</blockquote></div><br>