gtk-sharp 2.12.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. Gtk.Dialog Convenient message window

presents a with an image representing the (Error, Question, etc.) alongside some message text. It is available as a convenience. You could construct the equivalent of from without too much effort, but saves typing.

The is displayed using , which automatically makes the modal and waits for the user to respond to it. returns when any in the is clicked or the is closed.

After returns, you are responsible for hiding (using ) or destroying (using ) the dialog if you wish to do so.

A simple message dialog `MessageDialog md = new MessageDialog (parent_window, DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Close, "Error loading file"); int result = md.Run (); md.Destroy();`

A yes/no message dialog `MessageDialog md = new MessageDialog (parent_window, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.YesNo, "Are you sure you want to quit?"); ResponseType result = (ResponseType)md.Run (); if (result == ResponseType.Yes) Application.Quit(); else md.Destroy();`

If you would like the to not be modal, set the property to . `md.Modal = false;`

- Constructor
  2.12.0.0
  To be added
  To be added
- Constructor
  2.12.0.0
  System.Obsolete
  a
  Protected Constructor.
  Chain to this constructor if you have manually registered a native value for your subclass.
- Constructor
  2.12.0.0
  Pointer to the C object.
  Internal constructor

  This is an internal constructor, and should not be used by user code.

- Constructor
  2.12.0.0
  System.ParamArray
  the dialog's parent (or )
  the
  the type of message dialog to display
  the buttons to display
  the message format string
  optional arguments for
  Creates an instance of

  Creates an instance of `MessageDialog md = new MessageDialog (parent_window, Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Error, Gtk.ButtonsType.Close, "Error loading file '{0}'", filename);`

- Constructor
  2.12.0.0
  System.ParamArray
  the dialog's parent (or )
  the
  the type of message dialog to display
  the buttons to display
  whether or not uses Pango markup
  the message format string
  optional arguments for
  Creates an instance of
  Like the other constructor, but allows you to pass a non-marked-up string.
- Property
  2.12.0.0
  GLib.GType GType Property. a Returns the native value for .
- Property
  2.12.0.0
  GLib.Property("image")
  Gtk.Widget The image displayed in the MessageBox. a displayed in the image location.
- Property
  2.12.0.0
  System.String Markup for the message to display in the dialog. a Markup should be in Pango markup format. (TODO: check this.)
- Property
  2.12.0.0
  GLib.Property("message-type")
  Gtk.MessageType The of the an object of type The of the
- Property
  2.12.0.0
  GLib.Property("secondary-text")
  System.String The secondary message for the MessageBox. defaults to .
- Property
  2.12.0.0
  GLib.Property("secondary-use-markup")
  System.Boolean Indicates if Pango markup is handled in the secondary text.. if , markup is parsed. See for more info.
- Property
  2.12.0.0
  GLib.Property("text")
  System.String The primary text displayed in the MessageBox. the primary text string. If the box has secondary text, this is displayed as the Title.
- Property
  2.12.0.0
  GLib.Property("use-markup")
  System.Boolean Indicates if Pango markup is handled in the primary text. if , markup is parsed. See for more info.