mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
532e34fcd2
* ext/tk/lib/tkextlib/blt/*.rb: ditto * ext/tk/lib/tkextlib/blt/tile/*.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
61 lines
1.3 KiB
Ruby
61 lines
1.3 KiB
Ruby
#
|
|
# 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
|