Class: UI::Notification
- Inherits:
-
Object
- Object
- UI::Notification
Overview
UI::Notification objects allows you to show native notifications in the desktop, they are positioned in the top right of your screen, they can be customized to have a message, icon and accept and/or dismiss buttons with callback blocks.
Instance Method Summary # collapse
-
#icon_name ⇒ String
Gets the icon name, this is the path that will be used to get the icon from the file system path.
-
#icon_name=(icon_name) ⇒ Boolean
Sets the icon path, this icon will be loaded from the path give, the path has to be a local filesystem path.
-
#icon_tooltip ⇒ String
Gets the icon Tooltip, this is the string that appear when the mouse is over the icon.
-
#icon_tooltip=(icon_tooltip) ⇒ Boolean
Sets the icon Tooltip, this string will appear when the mouse is over the icon.
-
#initialize(sketchup_extension, message, icon_name, icon_tooltip) ⇒ UI::Notification
constructor
The new method is used to create a new Notification.
-
#message ⇒ String
Gets the message as string.
-
#message=(message) ⇒ Boolean
Sets a new message, notifications are meant for quick & brief messages, remember that they are dismissed automatically.
-
#on_accept(title, block) ⇒ Boolean
Shows a button in the notification with the given title and callback block, both arguments are required.
-
#on_accept_title ⇒ String
Returns the accept's button title.
-
#on_dismiss(title, block) ⇒ Boolean
Shows a button in the notification with the given title and callback block, both arguments are required.
-
#on_dismiss_title ⇒ String
Returns the dismiss's button title.
-
#show ⇒ Boolean
Shows the notification in the top right of the screen, the notifications will be ordered from top to bottom if multiple notifications are shown, it will automatically be dismissed if no action is taken.
Constructor Details
↑ #initialize(sketchup_extension, message, icon_name, icon_tooltip) ⇒ UI::Notification
The new method is used to create a new UI::Notification.
In order to insert line breaks into the message you need to use \r\n.
Instance Method Details
↑ #icon_name ⇒ String
Gets the icon name, this is the path that will be used to get the icon from the file system path.
↑ #icon_name=(icon_name) ⇒ Boolean
Sets the icon path, this icon will be loaded from the path give, the path has to be a local filesystem path.
↑ #icon_tooltip ⇒ String
Gets the icon Tooltip, this is the string that appear when the mouse is over the icon.
↑ #icon_tooltip=(icon_tooltip) ⇒ Boolean
Sets the icon Tooltip, this string will appear when the mouse is over the icon.
↑ #message=(message) ⇒ Boolean
Sets a new message, notifications are meant for quick & brief messages, remember that they are dismissed automatically.
↑ #on_accept(title, block) ⇒ Boolean
Shows a button in the notification with the given title and callback block, both arguments are required.
↑ #on_dismiss(title, block) ⇒ Boolean
Shows a button in the notification with the given title and callback block, both arguments are required.
↑ #show ⇒ Boolean
Shows the notification in the top right of the screen, the notifications will be ordered from top to bottom if multiple notifications are shown, it will automatically be dismissed if no action is taken.