Encontrei este stackoverflow post , que leva à documentação na função de execução de um GtkDialog, onde afirma:
The run() method blocks in a recursive main loop until the dialog either emits the "response" signal, or is destroyed. If the dialog is destroyed, the run() method returns gtk.RESPONSE_NONE; otherwise, it returns the response ID from the "response" signal emission. Before entering the recursive main loop, the run() method calls the gtk.Widget.show() on the dialog for you. Note that you still need to show any children of the dialog yourself.
During the run() method, the default behavior of "delete_event" is disabled; if the dialog receives a "delete_event", it will not be destroyed as windows usually are, and the run() method will return gtk.RESPONSE_DELETE_EVENT. Also, during the run() method the dialog will be modal. You can force the run() method to return at any time by calling response() to emit the "response" signal. Destroying the dialog during the run() method is a very bad idea, because your post-run code won't know whether the dialog was destroyed or not.
After the run() method returns, you are responsible for hiding or destroying the dialog as needed.
E também no tutorial do PyGTK 3 :
Finally, there are two ways to remove a dialog. The Gtk.Widget.hide() method removes the dialog from view, however keeps it stored in memory. This is useful to prevent having to construct the dialog again if it needs to be accessed at a later time. Alternatively, the Gtk.Widget.destroy() method can be used to delete the dialog from memory once it is no longer needed. It should be noted that if the dialog needs to be accessed after it has been destroyed, it will need to be constructed again otherwise the dialog window will be empty.
Assim, seguindo esses bits de informação, se você chamar a função hide da caixa de diálogo antes de receber o evento delete, ela não será destruída e você poderá continuar chamando a execução, para trazer a caixa de diálogo para o foco.
por exemplo,
def on_mnu_test_dialog_activate(self, widget, data=None):
result = self.TestDialog.run()
if result == Gtk.ResponseType.OK:
print "The OK button was clicked"
self.TestDialog.hide()
Além disso, apenas para responder à sua segunda pergunta.
No meu exemplo, importei a classe para o diálogo:
from dialog_show.TestDialog import TestDialog
Em seguida, na função finish_initializing, criei uma variável de instância para o diálogo:
self.TestDialog = TestDialog()
Eu posso acessar as propriedades assim:
self.TestDialog.ui.txt_entry1.get_text()
ou, como sugerido por John,
self.TestDialog.builder.get_object("txt_entry1").get_text()