module Plugin::GUI::TabLike

Attributes

deletable[RW]
icon[R]

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File core/plugin/gui/tablike.rb, line 7
def initialize(*args)
  @expand = true
  super
end

Public Instance Methods

<<(child, *args)
Alias for: add_child
add_child(child, *args) click to toggle source
Calls superclass method
# File core/plugin/gui/tablike.rb, line 32
def add_child(child, *args)
  result = super(child, *args)
  pack_rule[children.index(child)] = expand?
  result end
Also aliased as: <<
cluster(slug, &proc) click to toggle source

プロフィールを作成してこの中に入れる

Args

slug

プロフィールスラッグ

&proc

処理

Return

新しく作成したプロフィール

# File core/plugin/gui/tablike.rb, line 56
def cluster(slug, &proc)
  cluster = Plugin::GUI::Cluster.instance(slug)
  self << cluster
  pack_rule.push(expand?)
  cluster.instance_eval(&proc) if proc
  cluster end
expand(new = true) click to toggle source

できるだけ大きく表示する

Return

self

# File core/plugin/gui/tablike.rb, line 22
def expand(new = true)
  @expand = new
  self end
expand?() click to toggle source
# File core/plugin/gui/tablike.rb, line 26
def expand?
  @expand end
name=(new_name) click to toggle source
Calls superclass method
# File core/plugin/gui/tablike.rb, line 93
def name=(new_name)
  result = super new_name
  Plugin.call(:gui_tab_change_icon, self)
  result end
nativewidget(widget) click to toggle source

UIツールキットのウィジェット(Gtk等)をタブに入れる

Args

widget

ウィジェット

Return

self

# File core/plugin/gui/tablike.rb, line 68
def nativewidget(widget)
  i_container = Plugin::GUI::TabChildWidget.instance
  self << i_container
  Plugin.call("gui_nativewidget_join_#{self.class.role}".to_sym, self, i_container, widget)
  pack_rule.push(expand?)
  self end
pack_rule() click to toggle source
# File core/plugin/gui/tablike.rb, line 29
def pack_rule
  @pack_rule ||= [] end
set_deletable(new) click to toggle source
# File core/plugin/gui/tablike.rb, line 89
def set_deletable(new)
  @deletable = new
  self end
set_icon(icon) click to toggle source
# File core/plugin/gui/tablike.rb, line 75
def set_icon(icon)
  icon_model = case icon
  when Diva::Model
    icon
  when String
    Diva::Model(:photo)[icon]
  else
    raise RuntimeError, "Unexpected class `#{icon.class}'."
  end
  if @icon != icon_model
    @icon = icon_model
    Plugin.call(:gui_tab_change_icon, self) end
  self end
shrink() click to toggle source

できるだけ小さく表示する

Return

self

# File core/plugin/gui/tablike.rb, line 15
def shrink
  @expand = false
  self end
timeline(slug, &proc) click to toggle source

タイムラインを作成してこの中に入れる

Args

slug

タイムラインスラッグ

&proc

処理

Return

新しく作成したタイムライン

# File core/plugin/gui/tablike.rb, line 44
def timeline(slug, &proc)
  timeline = Plugin::GUI::Timeline.instance(slug)
  self << timeline
  timeline.instance_eval(&proc) if proc
  timeline end