Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/wish
- wm title . "TTk"
- wm minsize . 400 300
- set winWidth 800
- set winHeight 600
- set winX [expr ([winfo screenwidth .]-$winWidth)/2]
- set winY [expr ([winfo screenheight .]-$winHeight)/2]
- wm geometry . ${winWidth}x${winHeight}+${winX}+${winY}
- ttk::style theme use clam
- grid columnconfigure . 0 -weight 1
- grid rowconfigure . 0 -weight 1
- grid columnconfigure . 1 -weight 0
- grid rowconfigure . 1 -weight 0
- text .text -relief sunken -background blue -foreground white \
- -font [font create -family "PT Mono" -size 16 -weight normal] -blockcursor true \
- -yscrollcommand {.scrv set}
- grid .text -row 0 -column 0 -sticky NESW
- ttk::scrollbar .scrv -command {.text yview}
- grid .scrv -row 0 -column 1 -sticky NES
- ttk::frame .f_button
- grid .f_button -row 1 -column 0 -sticky ESW
- ttk::button .f_button.b_exit -text "Close" -command exit
- pack .f_button.b_exit -side left
- ttk::sizegrip .sz
- grid .sz -column 1 -row 1 -sticky NES
- .text insert 0.0 [read [open "ttk_test"]]
- focus .f_button.b_exit
- bind . <KeyPress-Escape> exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement