Sha256: ece8bb090866ed6705649906c1d90f55b4c5b8425bb1e7789efb244aa4d6a4aa

Contents?: true

Size: 1.4 KB

Versions: 6

Compression:

Stored size: 1.4 KB

Contents

#
#  tkextlib/tcllib/history.rb
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
#   * Part of tcllib extension
#   * Provides a history for Entry widgets
#

require 'tk'
require 'tk/entry'
require 'tkextlib/tcllib.rb'

# TkPackage.require('history', '0.1')
TkPackage.require('history')

module Tk::Tcllib
  module History
    PACKAGE_NAME = 'history'.freeze
    def self.package_name
      PACKAGE_NAME
    end

    def self.package_version
      begin
        TkPackage.require('history')
      rescue
        ''
      end
    end
  end
end

module Tk::Tcllib::History
  extend TkCore

  def self.init(entry, length=None)
    tk_call_without_enc('::history::init', entry.path, length)
    entry.extend(self)  # add methods to treat history to the entry widget
  end

  def self.remove(entry)
    tk_call_without_enc('::history::remove', entry.path)
    entry
  end

  def history_remove
    tk_call_without_enc('::history::remove', @path)
    self
  end

  def history_add(text)
    tk_call('::history::add', @path, text)
    self
  end

  def history_get
    simplelist(tk_call_without_enc('::history::get', @path))
  end

  def history_clear
    tk_call_without_enc('::history::clear', @path)
    self
  end

  def history_configure(opt, value)
    tk_call('::history::configure', @path, opt, value)
    self
  end

  def history_configinfo(opt)
    tk_call('::history::configure', @path, opt)
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
tk-win-0.2.2-x86-mingw32 lib/tkextlib/tcllib/history.rb
tk-win-0.2.1-x86-mingw32 lib/tkextlib/tcllib/history.rb
tk-win-0.2.0-x86-mingw32 lib/tkextlib/tcllib/history.rb
tk_as_gem-0.1.0 ext/lib/tkextlib/tcllib/history.rb
tk_as_gem-0.0.1 ext/lib/tkextlib/tcllib/history.rb
tk_as_gem-0.0.0 ext/lib/tkextlib/tcllib/history.rb