1 from os
import _exit
, fork
, execvp
, waitpid
, dup2
3 from rox
.MultipleChoice
import MultipleChoice
4 from rox
.support
import *
8 # Open a modal dialog box showing a message.
9 # The user can choose from a selection of buttons at the bottom.
10 # Returns -1 if the window is destroyed, or the number of the button
11 # if one is clicked (starting from zero).
13 # If a dialog is already open, returns -1 without waiting AND
14 # brings the current dialog to the front.
16 def get_choice(message
, title
, buttons
):
24 current_dialog
= MultipleChoice(message
, buttons
)
25 current_dialog
.set_title(title
)
26 choice_return
= current_dialog
.wait()
28 print "Return", choice_return
35 """Spawn a new process. Connect stderr to stdout."""
44 print "Warning: exec('%s') failed!" % argv
[0]
47 print "Error: fork() failed!"