Sha256: 6b97bc25c69866dcae772080d1e9bbfd175e312e2b028e69b73a5a5a2fbb4203

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

#
#  tkextlib/iwidgets/datefield.rb
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#

require 'tk'
require 'tkextlib/iwidgets.rb'

module Tk
  module Iwidgets
    class  Datefield < Tk::Iwidgets::Labeledwidget
    end
  end
end

class Tk::Iwidgets::Datefield
  TkCommandNames = ['::iwidgets::datefield'.freeze].freeze
  WidgetClassName = 'Datefield'.freeze
  WidgetClassNames[WidgetClassName] ||= self

  def __boolval_optkeys
    super() << 'gmt'
  end
  private :__boolval_optkeys

  def __strval_optkeys
    super() << 'textbackground'
  end
  private :__strval_optkeys

  def __font_optkeys
    super() << 'textfont'
  end
  private :__font_optkeys

  def get_string
    tk_call(@path, 'get', '-string')
  end
  alias get get_string

  def get_clicks
    number(tk_call(@path, 'get', '-clicks'))
  end

  def valid?
    bool(tk_call(@path, 'isvalid'))
  end
  alias isvalid? valid?

  def show(date=None)
    tk_call(@path, 'show', date)
    self
  end
  def show_now
    tk_call(@path, 'show', 'now')
    self
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tk-win-0.2.2-x86-mingw32 lib/tkextlib/iwidgets/datefield.rb
tk-win-0.2.1-x86-mingw32 lib/tkextlib/iwidgets/datefield.rb
tk-win-0.2.0-x86-mingw32 lib/tkextlib/iwidgets/datefield.rb