Class: Shoes::ListBox

Inherits:
Native show all
Defined in:
lib/shoes/basic.rb

Instance Attribute Summary

Attributes inherited from Native

#state

Attributes inherited from Basic

#args, #cleared, #hided, #initials, #parent, #shows

Attributes included from Mod

#click_proc, #hover_proc, #hovered, #leave_proc, #margin_bottom, #margin_left, #margin_right, #margin_top, #release_proc

Instance Method Summary collapse

Methods inherited from Native

#focus

Methods inherited from Basic

#clear, #fix_size, #hide, #initialize, #move, #move2, #move3, #positioning, #remove, #show, #style, #toggle

Methods included from Mod

#click, #hover, #leave, #release, #set_margin

Constructor Details

This class inherits a constructor from Shoes::Basic

Instance Method Details

#change(&blk) ⇒ Object



411
412
413
# File 'lib/shoes/basic.rb', line 411

def change &blk
  super @real, &blk
end

#choose(item) ⇒ Object



403
404
405
406
407
408
409
# File 'lib/shoes/basic.rb', line 403

def choose item
  unless @entry
    @real.active = @items.index item
  else
    @real.child.text = item.to_s
  end
end

#items=(items) ⇒ Object



415
416
417
418
419
# File 'lib/shoes/basic.rb', line 415

def items= items
  @items.length.times{real.remove_text 0}
  @items = items
  items.each{|item| real.append_text item.to_s}
end

#textObject



399
400
401
# File 'lib/shoes/basic.rb', line 399

def text
  @entry ? @real.active_text : @items[@real.active]
end