Class: UI::Notification
| Relationships | |
| Inherits: | Object | 
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.
Class Method Summary
- 
    
      .new(sketchup_extension, message = nil, icon_name = nil, icon_tooltip = nil)  ⇒ UI::Notification 
    
    constructor
    Creates a new Notificationobject.
Instance Attribute Summary
- 
    
      #icon_name  ⇒ String 
    
    rw
    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 
    
    rw
    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 
    
    rw
    Gets the icon Tooltip, this is the string that appear when the mouse is over the icon. 
- 
    
      #icon_tooltip=(icon_tooltip)  ⇒ Boolean 
    
    rw
    Sets the icon Tooltip, this string will appear when the mouse is over the icon. 
- 
    
      #message  ⇒ String 
    
    rw
    Gets the message as string. 
- 
    
      #message=(message)  ⇒ Boolean 
    
    rw
    Sets a new message. 
Instance Method Summary
- 
    
      #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
    .new(sketchup_extension, message = nil, icon_name = nil, icon_tooltip = nil)  ⇒ Notification 
  
In order to insert line breaks into the message you need to use \r\n.
Creates a new Notification object.
Instance Attribute Details
#icon_name ⇒ String (rw)
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  (rw)
  
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 (rw)
Gets the icon Tooltip, this is the string that appear when the mouse is over the icon.
    #icon_tooltip=(icon_tooltip)  ⇒ Boolean  (rw)
  
Sets the icon Tooltip, this string will appear when the mouse is over the icon.
#message ⇒ String (rw)
Gets the message as string.
    #message=(message)  ⇒ Boolean  (rw)
  
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.
Instance Method Details
    #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. This callback is only called if you press the Dismiss button, not when the time runs out and the notification automatically disappears.
#on_dismiss_title ⇒ String
Returns the dismiss’s button title.
    #show  ⇒ Boolean 
  
Shows the notification. If not interacted with, the notification will disappear without calling any callbacks.