Class: UI::Notification
- Inherits:
-
Object
- Object
- UI::Notification
- Defined in:
- lib/sketchup-api-stubs/stubs/UI/Notification.rb
Overview
UI::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, 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.
-
#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, 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.
119 120 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 119 def initialize(sketchup_extension, , icon_name, icon_tooltip) end |
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.
41 42 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 41 def icon_name end |
#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.
58 59 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 58 def icon_name=(icon_name) end |
#icon_tooltip ⇒ String
Gets the icon Tooltip, this is the string that appear when the mouse is over the icon.
72 73 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 72 def icon_tooltip end |
#icon_tooltip=(icon_tooltip) ⇒ Boolean
Sets the icon Tooltip, this string will appear when the mouse is over the icon.
89 90 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 89 def icon_tooltip=(icon_tooltip) end |
#message ⇒ String
Gets the message as string.
132 133 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 132 def end |
#message=(message) ⇒ Boolean
Sets a new message. Notifications are meant for quick & brief messages. Remember that they disappear automatically.
149 150 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 149 def () end |
#on_accept(title, block) ⇒ Boolean
Shows a button in the notification with the given title and callback block, both arguments are required.
178 179 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 178 def on_accept(title, block) end |
#on_accept_title ⇒ String
Returns the accept’s button title.
193 194 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 193 def on_accept_title end |
#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.
224 225 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 224 def on_dismiss(title, block) end |
#on_dismiss_title ⇒ String
Returns the dismiss’s button title.
239 240 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 239 def on_dismiss_title end |
#show ⇒ Boolean
Shows the notification. If not interacted with, the notification will disappear without calling any callbacks.
252 253 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 252 def show end |