Parent

Methods

Files

Wx::TextUrlEvent

Event fired when a user clicks or hovers over a hyperlink in a TextCtrl

Public Instance Methods

get_url() click to toggle source

Returns the string URL that is being interacted with in this event

# File wx/classes/texturlevent.rb, line 4
  def get_url
    text_ctrl = event_object
    # In the standard TextCtrl, the relevant URL is always the same as
    # the text clicked on, because all it does is highlight text that
    # look like a URL. In RichTextCtrl, however, the URL value can be
    # applied to any text (more like HTML), and so the URL has be
    # retrieved by getting the applied RichTextAttr style and inspecting
    # its property.
    if text_ctrl.kind_of?(Wx::RichTextCtrl)
      return text_ctrl.get_style(url_start).url
    else      
      return text_ctrl.value[url_start .. url_end]
    end
  end

Disabled; run with $DEBUG to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.