Class: GUI

core.GUI(psychoJS)

Graphic User Interface

Constructor

new GUI(psychoJS)

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

Members

(private) _getDialogSize

Get the size of the dialog.
Source:

(readonly) dialogMargin :Symbol

Dialog window margins.
Type:
  • Symbol
Source:

(readonly) dialogMaxSize :Symbol

Maximal dimensions of the dialog window.
Type:
  • Symbol
Source:

Methods

(private) _dialogOpen(dialogId) → {function}

Get the jQuery UI callback for opening the given dialog in the middle of the screen.
Parameters:
Name Type Description
dialogId String the dialog ID
Source:
Returns:
jquery ui open function
Type
function

(private) _dialogResize(dialogId)

Ensure that the browser window's resize events redimension and reposition the dialog UI.
Parameters:
Name Type Description
dialogId String the dialog ID
Source:

(private) _estimateDialogScalingFactor() → {boolean}

Estimate the scaling factor for the dialog popup windows.
Source:
Returns:
whether or not the scaling factor is different from the previously estimated one
Type
boolean

(private) _onKeyChange(gui, event)

Listener for change event for required keys.
Parameters:
Name Type Description
gui module:core.GUI this GUI
event Event event
Source:

(private) _onResourceEvents(signal)

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

(private) _updateOkButtonStatus()

Update the status of the OK button.
Source:

dialog()

Destroy the currently opened dialog box.
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:

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: