expyriment.io.TextMenu

class expyriment.io.TextMenu(heading, menu_items, width, position=None, text_size=None, gap=None, heading_font=None, text_font=None, background_colour=None, text_colour=None, heading_text_colour=None, select_background_colour=None, select_text_colour=None, select_frame_colour=None, select_frame_line_width=None, justification=None, scroll_menu=None, background_stimulus=None, mouse=None)

A class implementing a text menu.

__init__(heading, menu_items, width, position=None, text_size=None, gap=None, heading_font=None, text_font=None, background_colour=None, text_colour=None, heading_text_colour=None, select_background_colour=None, select_text_colour=None, select_frame_colour=None, select_frame_line_width=None, justification=None, scroll_menu=None, background_stimulus=None, mouse=None)

Create a text menu.

This creates a menu with items to be selected.

Parameters:
headingstr

menu heading

menu_itemsstr or list

list with menu items

widthint

width of the menu

position(int, int), optional
text_sizeint, optional
background_colour(int, int, int), optional

background colour of the menu

gapint, optional

size of gap (pixel) between heading and item list

heading_fontstr, optional

font to be used for the heading

text_fontstr, optional

font to be used for the text

text_colour(int, int, int), optional

text colour of the items

heading_text_colour(int, int, int), optional

text colour of the heading

select_background_colour(int, int, int), optional

background colour of the currently selected item

select_text_colour(int, int, int), optional

text colour of the currently selected item

select_frame_colour(int, int, int), optional

colour of the frame around the selected item

select_frame_line_widthint, optional

line width of the frame around the selected item

justificationint, optional

text justification: 0 (left), 1 (center), 2 (right)

scroll_menuint, optional

maximum length of a item list before a scroll menu will be display. If the parameter is 0 of False scroll menu will not be displayed

background_stimulusvisual expyriment stimulus, optional

The background stimulus is a second stimulus that will be presented together with the TextMenu. For both stimuli overlap TextMenu will appear on top of the background_stimulus

mouseexpyriment.io.Mouse object or True, optional

If True or a mouse object is given, the menu will be controlled by the mouse

property background_colour

Getter for background_colour

property background_stimulus

Getter for background_stimulus

property gap

Getter for gap

get(preselected_item=0)

Present the menu and return the selected item.

Parameters:
preselected_itemint, optional

item that is preselected when showing menu

Returns:
selectedint

integer representing the selected item in the list

property heading

Getter for heading

property heading_text_colour

Getter for heading_text_colour

property justification

Getter for justification

property logging

Getter for logging.

property menu_items

Getter for menu_items

property position

Getter for position

property scroll_menu

Getter for scroll_menu

property select_background_colour

Getter for select_background_colour

property select_frame_colour

Getter for select_frame_colour

property select_frame_line_width

Getter for select_frame_line_width

property select_text_colour

Getter for select_text_colour

set_logging(onoff)

Set logging of this object on or off

Parameters:
onoffbool

set logging on (True) or off (False)

property text_colour

Getter for text_colour

property text_size

Getter for text_size