Class: UI::Notification
- Inherits:
-
Object
- Object
- UI::Notification
- Defined in:
- lib/sketchup-api-stubs/stubs/UI/Notification.rb
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.
127 128 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 127 def initialize(sketchup_extension, = nil, icon_name = nil, icon_tooltip = nil) 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.
42 43 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 42 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.
59 60 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 59 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.
74 75 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 74 def icon_tooltip end |
#icon_tooltip=(icon_tooltip) ⇒ Boolean
Sets the icon Tooltip, this string will appear when the mouse is over the icon.
91 92 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 91 def icon_tooltip=(icon_tooltip) end |
#message ⇒ String
Gets the message as string.
140 141 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 140 def end |
#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.
160 161 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 160 def () end |
#on_accept(title, block) ⇒ Boolean
Shows a button in the notification with the given title and callback block, both arguments are required.
189 190 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 189 def on_accept(title, block) end |
#on_accept_title ⇒ String
Returns the accept’s button title.
204 205 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 204 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.
235 236 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 235 def on_dismiss(title, block) end |
#on_dismiss_title ⇒ String
Returns the dismiss’s button title.
250 251 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 250 def on_dismiss_title end |
#show ⇒ Boolean
Shows the notification. If not interacted with, the notification will disappear without calling any callbacks.
266 267 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 266 def show end |