1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/tk/lib/tkextlib/bwidget/pagesmanager.rb
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00

74 lines
1.3 KiB
Ruby

# frozen_string_literal: false
#
# tkextlib/bwidget/pagesmanager.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
require 'tk/frame'
require 'tkextlib/bwidget.rb'
module Tk
module BWidget
class PagesManager < TkWindow
end
end
end
class Tk::BWidget::PagesManager
TkCommandNames = ['PagesManager'.freeze].freeze
WidgetClassName = 'PagesManager'.freeze
WidgetClassNames[WidgetClassName] ||= self
def tagid(id)
# id.to_s
_get_eval_string(id)
end
def add(page, &b)
win = window(tk_send('add', tagid(page)))
if b
if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
win.instance_exec(self, &b)
else
win.instance_eval(&b)
end
end
win
end
def compute_size
tk_send('compute_size')
self
end
def delete(page)
tk_send('delete', tagid(page))
self
end
def get_frame(page, &b)
win = window(tk_send('getframe', tagid(page)))
if b
if TkCore::WITH_RUBY_VM ### Ruby 1.9 !!!!
win.instance_exec(self, &b)
else
win.instance_eval(&b)
end
end
win
end
def get_page(page)
tk_send('pages', page)
end
def pages(first=None, last=None)
list(tk_send('pages', first, last))
end
def raise(page=None)
tk_send('raise', page)
self
end
end