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, 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.
100 101 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 100 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.
25 26 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 25 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.
42 43 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 42 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.
56 57 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 56 def icon_tooltip end |
#icon_tooltip=(icon_tooltip) ⇒ Boolean
Sets the icon Tooltip, this string will appear when the mouse is over the icon.
73 74 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 73 def icon_tooltip=(icon_tooltip) end |
#message ⇒ String
Gets the message as string.
113 114 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 113 def end |
#message=(message) ⇒ Boolean
Sets a new message, notifications are meant for quick & brief messages, remember that they are dismissed automatically.
130 131 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 130 def () end |
#on_accept(title, block) ⇒ Boolean
Shows a button in the notification with the given title and callback block, both arguments are required.
156 157 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 156 def on_accept(title, block) end |
#on_accept_title ⇒ String
Returns the accept’s button title.
171 172 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 171 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.
197 198 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 197 def on_dismiss(title, block) end |
#on_dismiss_title ⇒ String
Returns the dismiss’s button title.
212 213 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 212 def on_dismiss_title end |
#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.
226 227 |
# File 'lib/sketchup-api-stubs/stubs/UI/Notification.rb', line 226 def show end |