In AskYesNoCancel() treat the "yes" and "no" buttons the same way as the cancel
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 10 Feb 2000 16:15:53 +0000 (16:15 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 10 Feb 2000 16:15:53 +0000 (16:15 +0000)
button (i.e. an empty label hides the button).

Mac/Lib/EasyDialogs.py

index 44ac2b8c9dd5c8ec7e6a5fa61f70e5843507aa8b..1327243d28d2441605262a353ced4fdf8fbd74c4 100644 (file)
@@ -171,11 +171,17 @@ def AskYesNoCancel(question, default = 0, yes=None, no=None, cancel=None, id=262
        h = d.GetDialogItemAsControl(5)
        SetDialogItemText(h, lf2cr(question))
        if yes != None:
-               h = d.GetDialogItemAsControl(2)
-               h.SetControlTitle(yes)
+               if yes == '':
+                       d.HideDialogItem(2)
+               else:
+                       h = d.GetDialogItemAsControl(2)
+                       h.SetControlTitle(yes)
        if no != None:
-               h = d.GetDialogItemAsControl(3)
-               h.SetControlTitle(no)
+               if no == '':
+                       d.HideDialogItem(3)
+               else:
+                       h = d.GetDialogItemAsControl(3)
+                       h.SetControlTitle(no)
        if cancel != None:
                if cancel == '':
                        d.HideDialogItem(4)