Sidebar

Home



Expressions V4


Tutorials

How-To

Reference

  Lexical basics
  Type system
  Variables and assignment
  Operators
  Expression rules
  Control flow
  Functions
  Built-in functions
   None and NaN
   Arithmetic
   Algebra
   Logarithmic and Exponential
   Trigonometric
   Rounding and Centering
   Strings
   Output, Formatting, and Errors
   Dialogs, Clipboard, Platform, and Paths
  Methods and properties
  Built-in methods
   Common Value Methods
   Number Methods
   String Basic Methods
   String Slice Methods
   String Parsing Methods
   String Formatting Methods
   String Regex Methods
   String Trim and Case Methods
  Objects
  Built-in objects
   Collections
    array
    map
    data_array
   Image data
   Image stream
   Dialogs
    file_open
    file_save
    msgok
    msgokcancel
    msgyesno
    msgpassword
   GUI objects
    window
    panel
    group
    splitpanel
    label
    textbutton
    drawablebutton
    togglebutton
    togglegroup
    textinput
    textedit
    numinput
    slider
    combobox
    listbox
    progressbar
    led
    separator
    menu
    image
    snake
  Classes and user-defined objects
  Include system
  Error model
  Execution model and sessions
  Host integration
  Limits and performance
  Formal reference
  Glossary

Cookbook

exprv4:reference:objects:dialog_msgyesno


msgyesno

`msgyesno()` creates a Yes/No message dialog object.

Use it for questions where the user chooses between yes and no.

Constructor

msgyesno()

Creates a Yes/No message dialog.

dlg = msgyesno();

Properties

Property Type Description
`title` string Dialog title.
`message` string Dialog message text.
`buttons` boolean Whether dialog buttons are shown.
`has_result` boolean `true` after the dialog has produced a result.
`action` string Result action: `ok`, `cancel`, or `none`.
`ok` boolean `true` for the affirmative result.
`cancel` boolean `true` for the negative/cancel result.
`save` boolean Save flag in result map. Usually `false` for `msgyesno`.

Methods

Method Returns Description
`title(text)` self Sets the dialog title.
`message(text)` self Sets the dialog message.
`buttons(enabled)` self Shows or hides dialog buttons.
`on_result(callback)` self Sets asynchronous result callback.
`show()` map or self Shows the dialog. Returns result map unless `on_result()` is used.
`click_ok()` boolean Clicks the affirmative button on an active asynchronous dialog.
`click_close()` boolean Clicks Close on an active asynchronous dialog.

Example

result = msgyesno()
    .title("Question")
    .message("Use tool length sensor?")
    .show();
 
if (result.affirmative)
{
    print("yes");
}
else
{
    print("no");
}

Previous: msgokcancel

Next: msgpassword

exprv4/reference/objects/dialog_msgyesno.txt · Last modified: by 127.0.0.1

Page Tools