PanedWindowサイズ変更時のイベント取得

【ご質問】
PanedWindowのサイズ変更のイベントを取得することは可能でしょうか。

【回答】
PanedWindowクラスのSashオブジェクトに対してドラッグ、ドロップの
イベントハンドラを追加する事でサイズ変更のイベントを取得する事が可能です。

詳細は以下のサンプルをご参照ください。

{curl 6.0,7.0,8.0 applet}
{curl-file-attributes character-encoding = “shift-jis”}

{define-class MyFrame {inherits Frame}
  {constructor {default …}
    {construct-super
        …}
  }
}

{value
    def p = {PanedWindow
                   width = 50mm,
                   height = 50mm,
                   background = “red”
               }
    def p1 = {MyFrame
                     background = “blue”,
                     width = {add-stretch},
                     height = {add-stretch}
                 }
    def p2 = {MyFrame
                     background = “yellow”,
                     width = {add-stretch},
                     height = {add-stretch}
                 }
    {p.add-pane {Pane p1, p}}
    {p.add-pane {Pane p2, p}}
    {for i:int = 0 below {p.pane-count} do
        {{p.get i}.add-event-handler
            {on AttachEvent at mf:Pane do
                {{mf.get-view}.add-event-handler
                    {on vre:ViewResizeEvent do
                        {output “Viewのサイズ変更中”}
                    }
                }
            }
        }
    }

    let pro = {proc {g:any}:void
                     {for g:Graphic in g.graphical-children do
                         {if g isa Sash then
                             let sash:Sash = g asa Sash
                             {sash.add-event-handler
                                 {on DragStarted  do
                                     {dump “サイズ変更開始”}
                                 }
                             }
                             {sash.add-event-handler
                                 {on GrabRelease do
                                     {dump “サイズ変更終了”}
                                 }
                             }
                             {break}
                         else
                             {pro g}
                      }
                  }
              }
    {pro p}
    p
}

また、APIリファレンスの
[CURL.GUI.BASE]-[PanedWindow]・[Sash]
の項をご参照ください。