awsc.base_control.SingleNameDialog

class awsc.base_control.SingleNameDialog(parent, title, callback, *args, label='Name:', what='name', subject='', default='', caller=None, accepted_inputs=None, **kwargs)

A convenience class for quickly creating a dialog for entering a single string in a textfield.

Attributes:
whatstr, default=”name”

The piece of data being entered into the field.

error_labelawsc.termui.dialog.DialogFieldLabel

An error label, where validation errors may be displayed.

name_fieldawsc.termui.dialog.DialogFieldText

The textfield where the name or other data may be typed.

callerawsc.termui.control.Control

The control which opened this dialog.

callbackcallable

Callback to call when the dialog is confirmed.

Methods

accept_and_close()

Callback for the affirmative action of the dialog.

add_block(block)

Adds a new child block to this block.

add_field(field)

Inserts a new field into the dialog.

before_paint()

Hook function for acting on the block before any blocks are painted for the current frame.

bottomright()

Returns the coordinates of the bottom right corner of the block.

clear_blocks([tag])

Removes all blocks with the matching tag from the child blocks of this block.

close()

Callback for the negative action of the dialog.

input(key)

Input handler hook function.

nop()

A callable that does nothing, for the purpose of having such a callable.

opener(*args, caller, **kwargs)

Session-aware initializer for this class.

paint()

Hook function for painting the block.

remove_block(block)

Removes a specific block from this block.

reparent()

Shorthand function for removing a Block from its parent and re-adding it.

set_title_label(text)

Sets the text on the title label.

topleft()

Returns the coordinates of the top left corner of the block.

on_become_frame

__init__(parent, title, callback, *args, label='Name:', what='name', subject='', default='', caller=None, accepted_inputs=None, **kwargs)

Initializes a Control object.

Parameters:
borderawsc.termui.control.Border

The border of the control.

Methods

__init__(parent, title, callback, *args[, ...])

Initializes a Control object.

accept_and_close()

Callback for the affirmative action of the dialog.

add_block(block)

Adds a new child block to this block.

add_field(field)

Inserts a new field into the dialog.

before_paint()

Hook function for acting on the block before any blocks are painted for the current frame.

bottomright()

Returns the coordinates of the bottom right corner of the block.

clear_blocks([tag])

Removes all blocks with the matching tag from the child blocks of this block.

close()

Callback for the negative action of the dialog.

input(key)

Input handler hook function.

nop()

A callable that does nothing, for the purpose of having such a callable.

on_become_frame()

opener(*args, caller, **kwargs)

Session-aware initializer for this class.

paint()

Hook function for painting the block.

remove_block(block)

Removes a specific block from this block.

reparent()

Shorthand function for removing a Block from its parent and re-adding it.

set_title_label(text)

Sets the text on the title label.

topleft()

Returns the coordinates of the top left corner of the block.

Attributes

border

Returns the border of the control.

corners

Read-only property for calculating the four corners of the block.

height

Read-only property for the height of the block.

inner

Read-only property for calculating the four inner corners of the block.

line_size

w_in

Read-only property for the inner width of the block.

width

Read-only property for the width of the block.