class Iup::MessageDialog
A predefined modal dialog used to display a message and requesting one of a constrained choice of responses.
Example
The following example shows off many of the features, setting up a question-type dialog with three buttons and a default response of “no”:
md = Iup::MessageDialog.new do |d| d.title = "Example MessageDialog" d.dialogtype = 'question' d.value = "Should we do this?" d.buttons = 'yesnocancel' d.buttondefault = 2 end md.popup puts "Clicked button is: #{md.buttonresponse}"
Note that popup must be used to show the dialog.
Also see: Iup.message
Attributes
Selects the icon to display: ‘error’ / ‘information’ / ‘message’ / ‘question’ / ‘warning’.
This dialog will be always in front of the parent dialog. If the parent is minimized, this dialog is automatically minimized. Important Closing the parent will also close the child, but the child dialog’s CLOSE_CB method will not be called.
Title text for the message dialog.
Message text to display within the dialog.
Public Class Methods
Source
# File lib/wrapped/messagedialog.rb, line 63 def initialize @handle = IupLib.IupMessageDlg yield self if block_given? end
Creates a new dialog. If a block is given, the new instance is yielded to it.
Public Instance Methods
Source
# File lib/wrapped/messagedialog.rb, line 72 def popup x=0, y=0 IupLib.IupPopup @handle, x, y end
Shows the dialog at position x, y.
-
x- x-coordinate to use, or one of show constants -
y- y-coordinate to use, or one of show constants