Sha256: 2cb13f3c78b7d78ae4aa931657f1a34d21c996a18c63d2f00e8616b7c81e9001

Contents?: true

Size: 1.27 KB

Versions: 6

Compression:

Stored size: 1.27 KB

Contents

#
#  tkextlib/blt/win_printer.rb
#
#      *** Windows only ***
#
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#

require 'tk'
require 'tkextlib/blt.rb'

module Tk::BLT
  class Printer < TkObject
    extend TkCore

    TkCommandNames = ['::blt::printer'.freeze].freeze

    def self.enum(attribute)
      simplelist(tk_call('::blt::printer', 'enum', attribute))
    end

    def self.names(pat=None)
      simplelist(tk_call('::blt::printer', 'names', pat))
    end

    def self.open(printer)
      self.new(printer)
    end

    #################################

    def initialize(printer)
      @printer_id = tk_call('::blt::printer', 'open', printer)
    end

    def close
      tk_call('::blt::print', 'close', @printer_id)
      self
    end
    def get_attrs(var)
      tk_call('::blt::print', 'getattrs', @printer_id, var)
      var
    end
    def set_attrs(var)
      tk_call('::blt::print', 'setattrs', @printer_id, var)
      self
    end
    def snap(win)
      tk_call('::blt::print', 'snap', @printer_id, win)
      self
    end
    def write(str)
      tk_call('::blt::print', 'write', @printer_id, str)
      self
    end
    def write_with_title(title, str)
      tk_call('::blt::print', 'write', @printer_id, title, str)
      self
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

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