menu

class child {
      inherit itk::Widget  
      public variable child_a
      constructor { args }  {
       itk_option add hull.width hull.height
       $itk_component(hull) configure -width 1050 -height 768 
       wm minsize [winfo toplevel $itk_component(hull)] 1050 768
       pack propagate $itk_interior 0
      
       itk_component add menu {
  menu $itk_interior.menu \
      -tearoff 0 \
      -borderwidth 1
  }
      
       [winfo toplevel $itk_component(hull)] configure \
      -menu $itk_component(menu)
      
       itk_component add sessionmenu {
   menu $itk_interior.menu.session \
       -tearoff 0
  }
      
    $itk_component(menu) add cascade \
      -label "Session" \
      -menu $itk_component(sessionmenu)

       eval itk_initialize $args
      }
}

posted @ 2011-08-05 13:51  greencolor  阅读(125)  评论(0编辑  收藏  举报