以下は、mkWidgetsのWidget一覧です。
Aclock, Calendar, Combobox, Document, Gridcontrol, Ibutton, Iconbox, Listcontrol, Pane, Progressbar, Scrollbox, Spinentry, Statusbar, Tabcontrol, Textframe, Toolbar, Tooltip, Treecontrol |
package require mkWidgets pack [aclock .clck -format "%p %I:%M"] |
package require mkWidgets pack [calendar .cale] |
package require mkWidgets pack [combobox .cbx -entries {{りんご} {みかん} {メロン} {バナナ}}] .cbx see 0 |
package require mkWidgets document .doc -title {Document Windows} -width 300 -height 100 .doc pack [label .doc.txt1 -text {DocumentウィンドウはMDIの子ウィンドウのように 親ウィンドウの中に位置します。} \ -border 1 -relief sunken -bg yellow] -fill both -expand 1 |
package require mkWidgets pack [gridcontrol .grid] .grid column insert Col1 end -text 品名 -width 60 ;#-align left .grid column insert Col2 end -text 単価 -width 60 ;#-align right .grid column insert Col3 end -text 数量 -width 60 ;#-align center .grid column insert Col4 end -text 合計 -width 60 ;#-align center .grid insert end {りんご 50 1 50} .grid insert end {みかん 30 2 60} .grid insert end {メロン 100 3 300} .grid insert end {バナナ 10 4 40} .grid tag add tYellow Col1.* .grid tag add tPink Col4.* .grid tag config tYellow -background yellow .grid tag config tPink -background pink |
package require mkWidgets image create photo imgFolder -file Folder.gif pack [ibutton .ibut -image imgFolder -text "フォルダの作成..."] |
large
small
list
package require mkWidgets foreach img {Folder Folder32 File File32 Notebook Notebook32} { image create photo img$img -file $img.gif } pack [iconbox .ibox -columns {Object {Description l 200}}] .ibox insert end object1 -text "フォルダ" -image imgFolder32 -smallimage imgFolder -values {{フォルダです。}} .ibox insert end object2 -text "テキスト" -image imgFile32 -smallimage imgFile -values {{テキストです。}} .ibox insert end object3 -text "文書" -image imgNotebook32 -smallimage imgNotebook -values {{文書です。}} .ibox selection set object1 #.ibox config -view large |
package require mkWidgets foreach img {Folder File Notebook} { image create photo img$img -file $img.gif } pack [listcontrol .list] .list column insert Col1 end -text File -width 120 .list column insert Col2 end -text Size -width 60 .list column insert Col3 end -text Date -width 60 .list insert end [list " フォルダ" 1000 2001/6/24] .list image create Col1.1 -image imgFolder .list insert end [list " ファイル" 50 2001/6/24] .list image create Col1.2 -image imgFile .list insert end [list " 文書" 100 2001/6/24] .list image create Col1.3 -image imgNotebook .list selection set 1 |
package require mkWidgets . config -minsize {150 80} pack [pane .pan -width 3 -resize both] -fill both -expand 1 .pan pack first [text .frm1 -border 1 -relief sunken -bg white -wrap word] -fill both -expand 1 .pan pack second [frame .frm2 -border 1 -relief sunken -bg white] -fill both -expand 1 .frm1 insert end {こちらは左のPaneです。境界線は移動可能です。} |
package require mkWidgets pack [progressbar .prog -width 120 -height 22 -bg white] -padx 15 -pady 5 .prog set 50 |
package require mkWidgets pack [scrollbox .sbox] .sbox insert end {水平スクロールバーと} {垂直スクロールバーは} {自動的に配置されます。} .sbox config -scrollbar auto |
package require mkWidgets pack [spinentry .spi -value 0 -minimum -10 -maximum 10 -step .2] |
package require mkWidgets image create photo imgNotebook -file Notebook.gif statusbar .tbar -text {Status Bar} -ticks 5 .tbar add field1 -text { Any text } -image imgNotebook |
package require mkWidgets . config -minsize {160 90} pack [tabcontrol .tabc -width auto] -fill both -expand 1 -padx 10 -pady 10 label .tabc.fst -bg white -border 1 -relief sunken -text "1番目のタブ" label .tabc.snd -bg white -border 1 -relief sunken -text "2番目のタブ" label .tabc.thd -bg white -border 1 -relief sunken -text "3番目のタブ" .tabc insert first 0 -text " 1番目 " -window .tabc.fst .tabc insert second 0 -text " 2番目 " -window .tabc.snd .tabc insert third 0 -text " 3番目 " -window .tabc.thd .tabc invoke first |
package require mkWidgets pack [textframe .tfrm -text " タイトル "] -fill both -expand 1 label .tfrm.lab -text "フレームにタイトルが付けられます。" .tfrm pack .tfrm.lab |
package require mkWidgets foreach img {File Folder Large Iconbox Small List} { image create photo img$img -file $img.gif } toolbar .tbar .tbar add button b1 -image imgFile .tbar add button b2 -image imgFolder .tbar add separator s1 .tbar add radiobutton r1 -group g1 -image imgLarge .tbar add radiobutton r2 -group g1 -image imgIconbox .tbar add radiobutton r3 -group g1 -image imgSmall .tbar add radiobutton r4 -group g1 -image imgList |
package require mkWidgets tooltip .ttip -delay 500 pack [button .btn -text " Push! "] .ttip add .btn "押してください" |
package require mkWidgets image create photo imgFolder -file Folder.gif image create photo imgFile -file File.gif pack [treecontrol .tree -text {/} -image imgFolder] .tree insert bin -text bin -image imgFolder .tree insert ls -text ls -image imgFile -parent bin .tree insert usr -text usr -image imgFolder .tree insert tmp -text tmp -image imgFolder .tree expand bin |
package require mkWidgets . config -minsize {320 200} menu .menu -tearoff 0 menu .menu.file -tearoff 0 .menu.file add command -label 開く... -command testDocument .menu.file add separator .menu.file add command -label 終了 -command exit menu .menu.edit -tearoff 0 menu .menu.view -tearoff 0 menu .menu.wind -tearoff 0 .menu.wind add command -label {並べて表示} -command {arrangeDocs tile} .menu.wind add command -label {上下に並べて表示} -command {arrangeDocs horizontally} .menu.wind add command -label {左右に並べて表示} -command {arrangeDocs vertically} .menu.wind add command -label {重ねて表示} -command {arrangeDocs cascade} .menu.wind add separator .menu.wind add command -label {アイコンの整列} -command {arrangeDocs icons} .menu.wind add command -label {全て最小化} -command {arrangeDocs minimize} .menu.wind add command -label {全て閉じる} menu .menu.help -tearoff 0 .menu add cascade -menu .menu.file -label ファイル .menu add cascade -menu .menu.edit -label 編集 .menu add cascade -menu .menu.view -label 表示 .menu add cascade -menu .menu.wind -label ウィンドウ .menu add cascade -menu .menu.help -label ヘルプ . config -menu .menu pack [frame .work -bg gray50] -fill both -expand 1 tooltip .ttip toolbar .tbar statusbar .sbar .sbar push "OK" image create photo file -file images/File.gif set tbar [.tbar add button tool1 -image file -command {.menu.file invoke "開く..."}] .ttip add $tbar "開く..." proc arrangeDocs { sHow } { catch {::Document::Arrange $sHow} } set count 0 proc testDocument {} { global count incr count document .work.ddoc$count -title {Document Windows} -width 250 -height 100 .work.ddoc$count menu entryconf Close -command "destroy .work.ddoc$count" .work.ddoc$count pack [label .work.ddoc$count.txt1 \ -text "This and all the others are document windows\nAnything can be placed inside them." \ -border 1 -relief sunken -bg yellow] -fill both -expand 1 } |