Class: GUI

core.GUI(psychoJS)

Graphic User Interface

Constructor

new GUI(psychoJS)

Parameters:
Name Type Description
psychoJS PsychoJS the PsychoJS instance
Source:

Methods

(private) _onResourceEvents(signal)

Listener for resource event from the Server Manager.
Parameters:
Name Type Description
signal Object.<string, (string|Symbol)> the signal
Source:

dialog(options)

Show a message to the participant in a dialog box.

This function can be used to display both warning and error messages.

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
message string the message to be displayed
error Object.<string, *> an exception
warning string a warning message
showOK boolean <optional>
true specifies whether to show the OK button
onOK GUI.onOK <optional>
function called when the participant presses the OK button
Source:

dialog()

Destroy the currently opened dialog box.
Source:

DlgFromDict(options)

Create a dialog box that (a) enables the participant to set some experimental values (e.g. the session name), (b) shows progress of resource download, and (c) enables the partipant to cancel the experiment.

Setting experiment values

DlgFromDict displays an input field for all values in the dictionary. It is possible to specify default values e.g.:

let expName = 'stroop';
let expInfo = {'participant':'', 'session':'01'};
psychoJS.schedule(psychoJS.gui.DlgFromDict({dictionary: expInfo, title: expName}));

If the participant cancels (by pressing Cancel or by closing the dialog box), then the dictionary remains unchanged.

Parameters:
Name Type Description
options Object
Properties
Name Type Description
dictionary Object associative array of values for the participant to set
title String name of the project
Source: