class Gtk::UserList

Attributes

listview[R]

Public Class Methods

new() click to toggle source
Calls superclass method
# File core/mui/gtk_userlist.rb, line 23
def initialize
  super
  @listview = Gtk::InnerUserList.new(self)
  scrollbar = ::Gtk::VScrollbar.new(@listview.vadjustment)
  add Gtk::HBox.new(false, 0).add(@listview).closeup(scrollbar)
  @listview.ssc(:row_activated, &self.class.row_activated)
end
row_activated() click to toggle source

ユーザをダブルクリックとかされた時に呼ばれるProcを返す

Return

Proc

# File core/mui/gtk_userlist.rb, line 14
def self.row_activated
  ->(this, path, column) do
    iter = this.model.get_iter(path)
    if iter
      Plugin.call(:open, iter[Gtk::InnerUserList::COL_USER])
    end
  end
end

Public Instance Methods

add_user(users) click to toggle source

Userの配列 users を追加する

Args

users

Enumerable ユーザを繰り返すEnumerable

Return

self

# File core/mui/gtk_userlist.rb, line 42
def add_user(users)
  @to_a = nil
  @listview.add_user(users)
end
each() click to toggle source
# File core/mui/gtk_userlist.rb, line 31
def each
  @listview.each{ |m, p, i| i[Gtk::InnerUserList::COL_USER] } end
gen_order(user) click to toggle source
# File core/mui/gtk_userlist.rb, line 57
def gen_order(user)
  (@order_generator ||= gen_counter).call end
remove_user(users) click to toggle source

Userの配列 users に含まれるユーザを削除する

Args

users

ユーザの配列

Return

self

# File core/mui/gtk_userlist.rb, line 52
def remove_user(users)
  @to_a = nil
  @listview.remove_user(users)
end
reorder(user) click to toggle source

ユーザ user の順番を再計算する

Args

user

ユーザ

Return

self

# File core/mui/gtk_userlist.rb, line 65
def reorder(user)
  type_strict user => User
  @listview.reorder(user)
  self end
to_a() click to toggle source
# File core/mui/gtk_userlist.rb, line 34
def to_a
  @to_a ||= inject(Users.new, &:<<).freeze end