You are here

DisclosureTriangle

admin의 아바타

Tk widget implementation.

Tk의 프레임을 접었다 폈다 하는 간단한 패키지입니다.

source DisclosureTriangle.tcl

set msg {Give me chocolate}
set type ok

entry .e -textvariable msg -width 30
button .show -text Show -width 8 
    -command {tk_messageBox -message $msg -type $type}
button .exit -text Exit -width 8 -command exit
DisclosureTriangle::DisclosureTriangle .dt -separator 0 
    -font {{Arial Bold} 8 bold} -width 40 
    -showtext {Show Detail ...} -hidetext {Hide Detail}

pack .dt -side bottom -fill both -expand yes
pack .exit .show -side right -padx 2
pack .e -side left -fill x

set f [.dt getframe]
$f configure -bd 2 -relief groove
proc mkRadio {name value text} {
    radiobutton $name -variable type -value $value 
    -text $text -justify left
}
mkRadio $f.abort       abortretryignore Abort
mkRadio $f.ok          ok               OK
mkRadio $f.okcancel    okcancel         {OK Cancel}
mkRadio $f.retrycancel retrycancel      {Retry Cancel}
mkRadio $f.yesno       yesno            {Yes No}
mkRadio $f.yesnocancel yesnocancel      {Yes No Cancel}

grid $f.abort $f.ok $f.okcancel -sticky w
grid $f.retrycancel $f.yesno $f.yesnocancel -sticky w

wm resizable . 0 0
focus -force .

첨부 파일파일 크기
Image icon 1.jpg7.79 KB
Image icon 2.jpg11.79 KB
Package icon DisclosureTriangle.zip3.03 KB