- 364
- 0
- 约2.07万字
- 约 53页
- 2015-09-17 发布于重庆
- 举报
tcltk编程及应用简介,tcltk,r语言tcltk,rtcltk,plc编程及应用,vb网络编程及应用,焊接机器人编程及应用,plc编程及应用廖常初,s7200plc编程及应用,plc编程及应用第4版
Time Event: the after command proc Circle {} { global switcher if { $switcher == off } { # kill all after event, and then return } # do something for repeat after 1000 Circle } after milliseconds after ms arg ?arg...? after cancel id after cancel command after idle command after info ?id? Introduction for Tk Create children widgets Window is organized in a hierarchy A primary window -- the root of the hierarchy, is the main window of the application named as “.” . Widgets in primary window are it’s children window, named as “.name” And child window can has it’s own children ... “.name.name2...” First charactor of name should be in lower-case or a digital number frame .fBut frame .fText .fBut configure -borderwidth 1 ; .fText configure -borderwidth 1 entry .fBut.eEnt -width 20 set bBut [button .fBut.bHello -text HELLO! ] .fBut.eEnt configure -bg pink .fBut.bHello configure -command {.fBut.eEnt insert end hello!; .fText.tText insert end Hello } set tTr [text .fText.tText -yscrollcommand .fText.yscroll set -xscrollcommand .fText.xscroll set ] $tTr configure -width 40 -height 20 -foreground brown -wrap word scrollbar .fText.yscroll -command $tTr yview -orient vertical scrollbar .fText.xscroll -command $tTr xview -orient horizontal Display Widgets Put and display widgets in main window: .fBut : a Framework contains a single line text input entry .fText : a Framework contains a text will scrollbar .fBut.eEnt : The entry set bBut .fBut.bHello : A button set tTr .fText.text : Text body .fText.yscroll : X scroll bar (horizontal) .fText.xscroll : Y scroll bar (vertical) Three main geometry manager pack : constraint-based geometry manager grid : control in detail place: place a widget in another one pack .fBut .fText -side left -fill both -expand true grid .fBut.eEnt -sticky news grid $bBut -sticky news grid $tTr .fText.yscroll -sticky news grid .fText.xscroll -sticky ew grid rowconfigure .fText 0 -weight 1 grid columnconfig
原创力文档

文档评论(0)