Class: UI::Notification
- Inherits:
-
Object
- Object
- UI::Notification
Overview
Notification objects allows you to show native notifications in the desktop. Notifications can 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 = nil, icon_name = nil, icon_tooltip = nil) ⇒ UI::Notification
constructor
Creates a new Notification object.
-
#message ⇒ String
Gets the message as string.
-
#message=(message) ⇒ Boolean
Sets a new message.
-
#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.
-
#on_dismiss_title ⇒ String
Returns the dismiss's button title.
-
#show ⇒ Boolean
Shows the notification.
Constructor Details
↑ #initialize(sketchup_extension, message = nil, icon_name = nil, icon_tooltip = nil) ⇒ UI::Notification
In order to insert line breaks into the message you need to use \r\n.
Creates a new UI::Notification object.
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
In order to insert line breaks into the message you need to use \r\n.
Sets a new message. Notifications are meant for quick and brief messages. These message disappear automatically after a short while if they are not interacted with.
↑ #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. This callback is only called if you press the Dismiss button, not when the time runs out and the notification automatically disappears.
↑ #show ⇒ Boolean
Shows the notification. If not interacted with, the notification will disappear without calling any callbacks.