# wxNotificationMessage Class Reference
[Miscellaneous]

`#include </home/work/projects/wx/2.9/wx/interface/wx/notifmsg.h>`

Inheritance diagram for wxNotificationMessage:
[legend]

## Detailed Description

This class allows to show the user a message non intrusively.

Currently it is implemented natively only for the Maemo platform and uses (non-modal) dialogs for the display of the notifications under the other platforms but it will be extended to use the platform-specific notifications in the other ports in the future.

Notice that this class is not a window and so doesn't derive from wxWindow.

##

Library: wxAdvanced
Category: Miscellaneous

## Public Member Functions

| wxNotificationMessage ()
| Default constructor, use SetParent(), SetTitle() and SetMessage() to initialize the object before showing it.
| wxNotificationMessage (const wxString &title, const wxString &message=wxEmptyString, wxWindow *parent=NULL, int flags=wxICON_INFORMATION)
| Create a notification object with the given attributes.
virtual bool | Close ()
| Hides the notification.
void | SetFlags (int flags)
| This parameter can be currently used to specify the icon to show in the notification.
void | SetMessage (const wxString &message)
| Set the main text of the notification.
void | SetParent (wxWindow *parent)
| Set the parent for this notification: the notification will be associated with the top level parent of this window or, if this method is not called, with the main application window by default.
void | SetTitle (const wxString &title)
| Set the title, it must be a concise string (not more than 64 characters), use SetMessage() to give the user more details.
virtual bool | Show (int timeout=Timeout_Auto)
| Show the notification to the user and hides it after timeout seconds are elapsed.

List of all members.

## Constructor & Destructor Documentation

wxNotificationMessage::wxNotificationMessage | ( |  | ) |

Default constructor, use SetParent(), SetTitle() and SetMessage() to initialize the object before showing it.

wxNotificationMessage::wxNotificationMessage | ( | const wxString & | title,
|  | const wxString & | message = `wxEmptyString`,
|  | wxWindow * | parent = `NULL`,
|  | int | flags = `wxICON_INFORMATION` |
| ) |  |  |

Create a notification object with the given attributes.

See SetTitle(), SetMessage(), SetParent() and SetFlags() for the description of the corresponding parameters.

## Member Function Documentation

virtual bool wxNotificationMessage::Close | ( |  | ) | `[virtual]`

Hides the notification.

Returns true if it was hidden or false if it couldn't be done (e.g. on some systems automatically hidden notifications can't be hidden manually).

void wxNotificationMessage::SetFlags | ( | int | flags | ) |

This parameter can be currently used to specify the icon to show in the notification.

Valid values are `wxICON_INFORMATION`, `wxICON_WARNING` and `wxICON_ERROR` (notice that `wxICON_QUESTION` is not allowed here). Some implementations of this class may not support the icons.

void wxNotificationMessage::SetMessage | ( | const wxString & | message | ) |

Set the main text of the notification.

This should be a more detailed description than the title but still limited to reasonable length (not more than 256 characters).

void wxNotificationMessage::SetParent | ( | wxWindow * | parent | ) |

Set the parent for this notification: the notification will be associated with the top level parent of this window or, if this method is not called, with the main application window by default.

void wxNotificationMessage::SetTitle | ( | const wxString & | title | ) |

Set the title, it must be a concise string (not more than 64 characters), use SetMessage() to give the user more details.

virtual bool wxNotificationMessage::Show | ( | int | timeout = `Timeout_Auto` | ) | `[virtual]`

Show the notification to the user and hides it after timeout seconds are elapsed.

Special values `Timeout_Auto` and `Timeout_Never` can be used here, notice that you shouldn't rely on timeout being exactly respected because the current platform may only support default timeout value and also because the user may be able to close the notification.

Returns:
  false if an error occurred.

|  | [ top ]