std/gui/dialogue

Standard Library documentation

Dialogue helpers.

Module

Name
std/gui/dialogue
Area
Standard Library
Source
modules/std/gui/dialogue.zzm

NAME

std/gui/dialogue - Dialogue helpers.

SYNOPSIS

  from std/gui/dialogue import *;

  alert("Saved");
  let ok := confirm("Continue?");
  let name := prompt("Name:", value: "Ada");

IMPLEMENTATION SUPPORT

This module is supported by zuzu.pl, zuzu-rust, and zuzu-js on Electron and Browser. It is not supported by zuzu-js on Node.

DESCRIPTION

This module provides convenience dialogue helpers layered on top of the regular std/gui widgets.

EXPORTS

Functions

  • alert(String message, ... PairList p), alert_window(String message, ... PairList p)

    Parameters: message is display text and p contains options. Returns: null for alert or Window for alert_window. Shows or builds an alert dialogue.

  • confirm(String message, ... PairList p), confirm_window(String message, ... PairList p)

    Parameters: message is display text and p contains options. Returns: Boolean for confirm or Window for confirm_window. Shows or builds a confirmation dialogue.

  • prompt(String message, ... PairList p), prompt_window(String message, ... PairList p)

    Parameters: message is prompt text and p contains options such as value. Returns: String or null for prompt, or Window for prompt_window. Shows or builds a text prompt.

  • file_open(... PairList p), file_save(... PairList p)

    Parameters: p contains dialogue options. Returns: path value or null. Opens a file selection dialogue.

  • directory_open(... PairList p), directory_save(... PairList p)

    Parameters: p contains dialogue options. Returns: path value or null. Opens a directory selection dialogue.

  • colour_picker(... PairList p)

    Parameters: p contains dialogue options. Returns: String or null. Opens a colour picker and returns a normalized colour string.

  • file_open_window(... PairList p), file_save_window(... PairList p), directory_open_window(... PairList p), directory_save_window(... PairList p), colour_picker_window(... PairList p)

    Parameters: p contains dialogue options. Returns: Window. Builds the corresponding GUI dialogue window.

COPYRIGHT AND LICENCE

std/gui/dialogue is copyright Toby Inkster.

It is free software; you may redistribute it and/or modify it under the terms of either the Artistic License 1.0 or the GNU General Public License version 2.