Personal tools
From wiki.swiftlytilting.com
Jump to: navigation, search

WinBinder Manual/wb message box

int wb_message_box (int parent, string message [, string title [, int style]])

Creates and displays a message box and returns a value according to the button pressed.

Return values

Pressing either button "Cancel", "No", "Ignore" or "Abort" will return the integer value of 0.
Pressing "Ok", "Yes" or "Retry" will return the integer value of 1.

If the function is not successful it will return NULL.

Message box styles

  • WBC_WARNING
WBC_WARNING
  • WBC_INFO
WBC_INFO
  • WBC_OK
WBC_OK
  • WBC_OKCANCEL
WBC_OKCANCEL
  • WBC_QUESTION
WBC_QUESTION
  • WBC_STOP
WBC_STOP
  • WBC_YESNO
WBC_YESNO
  • WBC_YESNOCANCEL
WBC_YESNOCANCEL

Example

// Asks for confirmation before closing an application window

function process_main($window, $id)
{ 
   switch($id) { 
       case ID_EXIT: 
       case IDCLOSE: 
           if(wb_message_box($window, "Are your sure?", APPNAME, WBC_YESNO)) 
               wb_destroy_window($window); 
           break;
   }
}

See also

Winbinder Projects