class Gtk::IntelligentTextview

Attributes

fonts[RW]
get_background=[W]
style_generator[W]

Public Class Methods

addlinkrule(reg, leftclick, rightclick=nil) click to toggle source
# File core/mui/gtk_intelligent_textview.rb, line 24
def self.addlinkrule(reg, leftclick, rightclick=nil)
  @@linkrule = MIKU::Cons.new([reg, leftclick, rightclick].freeze, @@linkrule).freeze end
addwidgetrule(reg, widget = nil) click to toggle source
# File core/mui/gtk_intelligent_textview.rb, line 27
def self.addwidgetrule(reg, widget = nil)
  @@widgetrule = @@widgetrule.unshift([reg, (widget or Proc.new)]) end
new(msg = nil, default_fonts = {}, *rest, style: nil) click to toggle source
Calls superclass method
# File core/mui/gtk_intelligent_textview.rb, line 36
def initialize(msg = nil, default_fonts = {}, *rest, style: nil)
  super(*rest)
  @fonts = default_fonts
  @style_generator = style
  self.editable = false
  self.cursor_visible = false
  self.wrap_mode = Gtk::TextTag::WRAP_CHAR
  gen_body(msg) if msg
end
openurl(url) click to toggle source

URLを開く

# File core/mui/gtk_intelligent_textview.rb, line 31
def self.openurl(url)
  # gen_openurl_proc(url).call
  Gtk::TimeLine.openurl(url)
  false end

Public Instance Methods

bg_modifier(color = style_generator) click to toggle source
# File core/mui/gtk_intelligent_textview.rb, line 66
def bg_modifier(color = style_generator)
  if color.is_a? Gtk::Style
    self.style = color
  elsif get_window(Gtk::TextView::WINDOW_TEXT).respond_to?(:background=)
    get_window(Gtk::TextView::WINDOW_TEXT).background = color end
  queue_draw
  false end
get_background()
Alias for: style_generator
rewind(msg) click to toggle source

新しいテキスト msg に内容を差し替える。

Args

msg

表示する文字列

Return

self

# File core/mui/gtk_intelligent_textview.rb, line 79
def rewind(msg)
  type_strict msg => String
  set_buffer(Gtk::TextBuffer.new)
  gen_body(msg)
end
set_cursor(textview, cursor) click to toggle source

TODO プライベートにする

# File core/mui/gtk_intelligent_textview.rb, line 62
def set_cursor(textview, cursor)
  textview.get_window(Gtk::TextView::WINDOW_TEXT).set_cursor(Gdk::Cursor.new(cursor))
end
style_generator() click to toggle source

このウィジェットの背景色を返す

Return

Gtk::Style

# File core/mui/gtk_intelligent_textview.rb, line 49
def style_generator
  if @style_generator.respond_to? :to_proc
    @style_generator.to_proc.call
  elsif @style_generator
    @style_generator
  else
    parent.style.bg(Gtk::STATE_NORMAL)
  end
end
Also aliased as: get_background