public class QuestionMessageDialog extends MessageDialog
This is a modal MessageDialog of type QUESTION
with an "Yes" and a "No" Button.
You would typically use this in conjunction with run()
as
follows:
final Window main; final Dialog question; final ResponseType response; main = new Window(); ... question = new QuestionMessageDialog(main, "File exists!", "Do you really want to overwrite it?"); response = question.run(); question.hide(); if (response == ResponseType.YES) { // save file } else { // cancel and return to application }which will result in something like:
(depending on your theme, icon set, window manager preferences, of course). Notable here are the "question mark" icon and that the "No" Button has focus by default.
Dialog.Response
Window.ConfigureEvent, Window.DeleteEvent
Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.Destroy, Widget.Draw, Widget.EnterNotifyEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.QueryTooltip, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent
Constructor and Description |
---|
QuestionMessageDialog(Window parent,
String primary,
String secondary) |
getSecondaryUseMarkup, getUseMarkup, setImage, setSecondaryText, setSecondaryText, setSecondaryUseMarkup, setUseMarkup
add, addButton, addButton, addButton, connect, emitResponse, run, setDefaultResponse
addAcceleratorGroup, connect, connect, getHeight, getMaximized, getPositionX, getPositionY, getScreen, getWidth, move, present, resize, setDecorated, setDefaultSize, setFullscreen, setGravity, setHasResizeGrip, setIcon, setIcon, setKeepAbove, setKeepBelow, setMaximize, setModal, setPosition, setResizable, setSkipPagerHint, setSkipTaskbarHint, setStick, setTitle, setTransientFor, setTypeHint
getChildren, remove, setBorderWidth
activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, destroy, getAllocatedHeight, getAllocatedWidth, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getPreferredHeightForWidthMinimum, getPreferredHeightForWidthNatural, getPreferredHeightMinimum, getPreferredHeightNatural, getPreferredWidthForHeightMinimum, getPreferredWidthForHeightNatural, getPreferredWidthMinimum, getPreferredWidthNatural, getRequestMode, getRequisition, getSensitive, getStyleContext, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, overrideBackground, overrideColor, overrideFont, queueDraw, queueDrawArea, realize, setAlignHorizontal, setAlignVertical, setCanDefault, setCanFocus, setEvents, setExpandHorizontal, setExpandVertical, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll
public QuestionMessageDialog(Window parent, String primary, String secondary)