一、参数说明:  

  tearoff  :分窗,0为在原窗,1为点击分为两个窗口

  bg,fg  : 背景,前景

  borderwidth: 边框宽度

  font :  字体

  activebackgound   : 鼠标划过时背景,同样有activeforeground,activeborderwidth,

           disabledforeground

  cursor :当子菜单分离原窗时,鼠标在子菜单栏上的形状cursor="arrow""circle"

     "clock""cross""dotbox" "exchange""fleur""heart""heart""man"

     "mouse""pirate""plus"等图形

  postcommand :点击菜单的回调函数

  selectcolor  :     选中时背景色,add_checkbutton控件选中时,√的颜色

  takefocus  

  title        :当子菜单分离原窗时的标题

  type  

  relief   : 当子菜单分离原窗时的3D效果,relief=RAISED,SUNKEN,FLAT,RIDGE,SOLID,GROOVE

二、方法:    

  menu.add_cascade     :  添加子菜单(menu参数为子菜单对象)

  menu.add_command   :  添加命令(label参数为显示内容,command参数为响应函数)

  menu.add_separator   :  添加分隔线

  menu.add_checkbutton : 添加确认按钮,与add_radiobutton用法相同,效果为:

             点击时打钩(variable参数决定绑定变量)

  delete            :     删除

相关文章:

  • 2021-05-31
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2021-11-17
  • 2021-10-04
猜你喜欢
  • 2021-08-29
  • 2022-12-23
  • 2021-11-13
  • 2021-08-15
  • 2021-12-26
  • 2021-06-23
相关资源
相似解决方案