MessagingMenu.Message

g GObject.Object GObject.Object MessagingMenu.Message MessagingMenu.Message GObject.Object->MessagingMenu.Message

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (id, icon, title, subtitle, body, time)

add_action (id, label, parameter_type, parameter_hint)

get_body ()

get_draws_attention ()

get_icon ()

get_id ()

get_subtitle ()

get_time ()

get_title ()

set_draws_attention (draws_attention)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

body

str

r/w/co

First lines of the body of the message

draws-attention

bool

r/w

Whether the message should draw attention

icon

Gio.Icon

r/w/co

Icon of the message

id

str

r/w/co

Unique id of the message

subtitle

str

r/w/co

Subtitle of the message

time

int

r/w/co

Time the message was sent, in microseconds

title

str

r/w/co

Title of the message

Signals

Inherited:

GObject.Object (1)

Name

Short Description

activate

Emitted when the user has activated the message.

Fields

Inherited:

GObject.Object (1)

Class Details

class MessagingMenu.Message(**kwargs)
Bases:

GObject.Object

Abstract:

No

classmethod new(id, icon, title, subtitle, body, time)
Parameters:
  • id (str) – unique id of the message

  • icon (Gio.Icon or None) – a Gio.Icon representing the message

  • title (str) – the title of the message

  • subtitle (str or None) – the subtitle of the message

  • body (str or None) – the message body

  • time (int) – the time the message was received

Returns:

a new MessagingMenu.Message

Return type:

MessagingMenu.Message

Creates a new MessagingMenu.Message.

add_action(id, label, parameter_type, parameter_hint)
Parameters:

Adds an action with id and label to message. Actions are an alternative way for users to activate a message. Note that messages can still be activated without an action.

If parameter_type is non-None, the action is able to receive user input in addition to simply activating the action. Currently, only string parameters are supported.

A list of predefined parameters can be supplied as a GLib.Variant array of parameter_type in parameter_hint. If parameter_hint is floating, it will be consumed.

It is recommended to add at most two actions to a message.

get_body()
Returns:

the body of self

Return type:

str

get_draws_attention()
Returns:

whether self is drawing attention

Return type:

bool

get_icon()
Returns:

the icon of self

Return type:

Gio.Icon

get_id()
Returns:

the unique id of self

Return type:

str

get_subtitle()
Returns:

the subtitle of self

Return type:

str

get_time()
Returns:

the time at which self was received

Return type:

int

get_title()
Returns:

the title of self

Return type:

str

set_draws_attention(draws_attention)
Parameters:

draws_attention (bool) – whether self should draw attention

Sets whether self is drawing attention.

Signal Details

MessagingMenu.Message.signals.activate(message, action, parameter)
Signal Name:

activate

Flags:

RUN_FIRST, DETAILED

Parameters:

Emitted when the user has activated the message. The message is immediately removed from the application’s menu, handlers of this signal do not need to call MessagingMenu.App.remove_message().

Property Details

MessagingMenu.Message.props.body
Name:

body

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

First lines of the body of the message

MessagingMenu.Message.props.draws_attention
Name:

draws-attention

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

Whether the message should draw attention

MessagingMenu.Message.props.icon
Name:

icon

Type:

Gio.Icon

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Icon of the message

MessagingMenu.Message.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Unique id of the message

MessagingMenu.Message.props.subtitle
Name:

subtitle

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Subtitle of the message

MessagingMenu.Message.props.time
Name:

time

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Time the message was sent, in microseconds

MessagingMenu.Message.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Title of the message