David Hiltz wrote:
> 
> > #3 How do I create a simple yes/no dialog box with an info icon, or a
> > warning icon?  That was very easy in Tk.  I know Win32::GUI has a DialogBox
> > creation method, what flags need to go to the style tag to get a dialog like
> > that?
> 
>   I don't know if there is a style for that (maybe), but you can always
>   create your own yes/no dialog box and add a bitmap.

Were you looking for a Message Box? If so try Win32::MsgBox. (It's in
the base Win32 package not in Win32::GUI) It's used as
"Win32::MsgBox(MESSAGE [, FLAGS [, TITLE]])"

All of the following info can be found in the Win32::MsgBox docs.

The options for Flags are:

        0 = OK
        1 = OK and Cancel
        2 = Abort, Retry, and Ignore
        3 = Yes, No and Cancel
        4 = Yes and No
        5 = Retry and Cancel

        MB_ICONSTOP          "X" in a red circle
        MB_ICONQUESTION      question mark in a bubble
        MB_ICONEXCLAMATION   exclamation mark in a yellow triangle
        MB_ICONINFORMATION   "i" in a bubble

So, for a yes/no box with an info icon you'd use:
$message = Win32::MsgBox("Press either yes or no", 4 |
MB_ICONINFORMATION, "Error");

Then you check the $message variable for the return code.

The function returns the menu id of the selected push button:

        0  Error

        1  OK
        2  Cancel
        3  Abort
        4  Retry
        5  Ignore
        6  Yes
        7  No

Reply via email to