ScrollBarを使えば、実現可能かと思います。
下記サンプルをご参考にしてみてください。
Code:
{curl 8.0 applet}
{curl-file-attributes character-encoding = "utf8"}
{define-proc {sync-scroll src:ScrollBox, obj:ScrollBox}:void
{def src-vbar = {src.get-vscroll}}
{def src-hbar = {src.get-hscroll}}
{def obj-vbar = {obj.get-vscroll}}
{def obj-hbar = {obj.get-hscroll}}
||-- {output vsbar2}
||-- {output hsbar2}
{src-vbar.add-event-handler
{on e:Adjustment do
{obj-vbar.set-scroll-value {src-vbar.get-scroll-value}}
}
}
{src-hbar.add-event-handler
{on e:Adjustment do
{obj-hbar.set-scroll-value {src-hbar.get-scroll-value}}
}
}
}
{def vb1 = {VBox}}
{def sb1 = {ScrollBox width = 100px, height = 100px, vb1}}
{def vb2 = {VBox}}
{def sb2 = {ScrollBox width = 100px, height = 100px, vb2}}
||--{def make-ev1 =
||-- {proc {arg-sb:ScrollBox}:EventHandler
||-- {return
||-- {on PointerScroll at sb:ScrollBox do
||-- {after 0s do
||-- {arg-sb.scroll-to x = sb.horizontal-position, y = sb.vertical-position}
||-- }
||-- }
||-- }
||-- }
||--}
||--
||--{def make-ev2 =
||-- {proc {arg-sb:ScrollBox}:EventHandler
||-- {return
||-- {on pee:PointerEnvelopeEvent at sb:ScrollBox do
||-- {if pee.contents isa PointerMotion then
||-- {after 0s do
||-- {arg-sb.scroll-to x = sb.horizontal-position, y = sb.vertical-position}
||-- }
||-- }
||-- }
||-- }
||-- }
||--}
||--
||--{sb1.add-event-handler {make-ev1 sb2}}
||--{sb1.add-event-handler {make-ev2 sb2}}
||--{sb2.add-event-handler {make-ev1 sb1}}
||--{sb2.add-event-handler {make-ev2 sb1}}
{for i:int = 1 to 20 do
{vb1.add {Label i & "行目"}}
{vb2.add {Label i & "行目"}}
}
{sync-scroll sb1, sb2}
{View
{HBox
sb1,
sb2
},
visibility = "normal",
{on WindowClose do
{exit}
}
}