mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
d8465ff9ab
* BWidget extension support on Ruby/Tk git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
45 lines
823 B
Ruby
45 lines
823 B
Ruby
#
|
|
# tkextlib/bwidget/combobox.rb
|
|
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
|
|
#
|
|
|
|
require 'tk'
|
|
require 'tk/entry'
|
|
require 'tkextlib/bwidget.rb'
|
|
require 'tkextlib/bwidget/listbox'
|
|
require 'tkextlib/bwidget/spinbox'
|
|
|
|
module Tk
|
|
module BWidget
|
|
class ComboBox < Tk::BWidget::SpinBox
|
|
end
|
|
end
|
|
end
|
|
|
|
class Tk::BWidget::ComboBox
|
|
include Scrollable
|
|
|
|
TkCommandNames = ['ComboBox'.freeze].freeze
|
|
WidgetClassName = 'ComboBox'.freeze
|
|
WidgetClassNames[WidgetClassName] = self
|
|
|
|
def get_listbox(&b)
|
|
win = window(tk_send_without_enc('getlistbox'))
|
|
win.instance_eval(&b) if b
|
|
win
|
|
end
|
|
|
|
def icursor(idx)
|
|
tk_send_without_enc('icursor', idx)
|
|
end
|
|
|
|
def post
|
|
tk_send_without_enc('post')
|
|
self
|
|
end
|
|
|
|
def unpost
|
|
tk_send_without_enc('unpost')
|
|
self
|
|
end
|
|
end
|