mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/tk/lib/tk/*: untabify
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
05f5928c9d
commit
3514110b89
296 changed files with 13591 additions and 13558 deletions
|
@ -17,7 +17,7 @@ $cscroll_demo = TkToplevel.new {|w|
|
|||
|
||||
# label À¸À®
|
||||
TkLabel.new($cscroll_demo, 'font'=>$font, 'wraplength'=>'4i',
|
||||
'justify'=>'left', 'text'=>"このウィンドウにはスクロールバーやマウスのボタン2 でスクロールできるキャンバス widget が表示されています。四角の上でボタン1 をクリックすると、そのインデックスが標準出力に出力されます。"){
|
||||
'justify'=>'left', 'text'=>"このウィンドウにはスクロールバーやマウスのボタン2 でスクロールできるキャンバス widget が表示されています。四角の上でボタン1 をクリックすると、そのインデックスが標準出力に出力されます。"){
|
||||
pack('side'=>'top')
|
||||
}
|
||||
|
||||
|
@ -51,14 +51,14 @@ end
|
|||
|
||||
# canvas ÀßÄê
|
||||
$cscroll_canvas = TkCanvas.new($cscroll_demo,
|
||||
'relief'=>'sunken', 'borderwidth'=>2,
|
||||
'scrollregion'=>['-11c', '-11c', '50c', '20c']
|
||||
) {|c|
|
||||
'relief'=>'sunken', 'borderwidth'=>2,
|
||||
'scrollregion'=>['-11c', '-11c', '50c', '20c']
|
||||
) {|c|
|
||||
if $tk_version =~ /^4\.[01]/
|
||||
pack('expand'=>'yes', 'fill'=>'both')
|
||||
else
|
||||
grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>0,
|
||||
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
||||
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
||||
end
|
||||
|
||||
TkScrollbar.new($cscroll_demo, 'command'=>proc{|*args| c.yview(*args)}) {|vs|
|
||||
|
@ -67,18 +67,18 @@ $cscroll_canvas = TkCanvas.new($cscroll_demo,
|
|||
pack('side'=>'right', 'fill'=>'y')
|
||||
else
|
||||
grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>0, 'column'=>1,
|
||||
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
||||
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
||||
end
|
||||
}
|
||||
|
||||
TkScrollbar.new($cscroll_demo, 'orient'=>'horiz',
|
||||
'command'=>proc{|*args| c.xview(*args)}) {|hs|
|
||||
'command'=>proc{|*args| c.xview(*args)}) {|hs|
|
||||
c.xscrollcommand(proc{|first,last| hs.set first,last})
|
||||
if $tk_version =~ /^4\.[01]/
|
||||
pack('side'=>'bottom', 'fill'=>'x')
|
||||
else
|
||||
grid('in'=>$cscroll_grid, 'padx'=>1, 'pady'=>1, 'row'=>1, 'column'=>0,
|
||||
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
||||
'rowspan'=>1, 'columnspan'=>1, 'sticky'=>'news')
|
||||
end
|
||||
}
|
||||
}
|
||||
|
@ -89,9 +89,9 @@ bg = $cscroll_canvas.configinfo('bg')[4]
|
|||
y = -10
|
||||
(0..9).each{|j|
|
||||
TkcRectangle.new($cscroll_canvas, "#{x}c", "#{y}c", "#{x+2}c", "#{y+2}c",
|
||||
'outline'=>'black', 'fill'=>bg, 'tags'=>'rect')
|
||||
'outline'=>'black', 'fill'=>bg, 'tags'=>'rect')
|
||||
TkcText.new($cscroll_canvas, "#{x+1}c", "#{y+1}c",
|
||||
'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text')
|
||||
'text'=>"#{i},#{j}", 'anchor'=>'center', 'tags'=>'text')
|
||||
y += 3
|
||||
}
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ $cscroll_canvas.itembind('all', '1', proc{scrollButton $cscroll_canvas})
|
|||
$cscroll_canvas.itembind('all', 'Any-Enter', proc{scrollEnter $cscroll_canvas})
|
||||
$cscroll_canvas.bind('2', proc{|x,y| $cscroll_canvas.scan_mark(x,y)}, '%x %y')
|
||||
$cscroll_canvas.bind('B2-Motion',
|
||||
proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y')
|
||||
proc{|x,y| $cscroll_canvas.scan_dragto(x,y)}, '%x %y')
|
||||
|
||||
def scrollEnter(c)
|
||||
id = c.find_withtag('current')[0].id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue