File: example.tcl

package info (click to toggle)
r-cran-tcltk2 1.2-10-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,356 kB
  • ctags: 1,386
  • sloc: tcl: 37,888; ansic: 792; python: 324; sh: 68; sed: 16; makefile: 1
file content (31 lines) | stat: -rw-r--r-- 959 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Demonstrate widget tooltip
#package require tooltip
source ./tooltip.tcl
pack [label .l -text "label"]
tooltip::tooltip .l "This is a label widget"

# Demonstrate menu tooltip
#package require tooltip
. configure -menu [menu .menu]
.menu add cascade -label Test -menu [menu .menu.test -tearoff 0]
.menu.test add command -label Tooltip
tooltip::tooltip .menu.test -index 0 "This is a menu tooltip"

# Demonstrate canvas item tooltip
#package require tooltip
pack [canvas .c]
set item [.c create rectangle 10 10 80 80]
tooltip::tooltip .c -item $item "Canvas item tooltip"

# Demonstrate listbox item tooltip
#package require tooltip
pack [listbox .lb]
.lb insert 0 "item one"
tooltip::tooltip .lb -item 0 "Listbox item tooltip"

# Demonstrate text tag tooltip
#package require tooltip
pack [text .txt]
.txt tag configure TIP-1 -underline 1
tooltip::tooltip .txt -tag TIP-1 "tooltip one text"
.txt insert end "An example of a " {} "tooltip" TIP-1 " tag.\n" {}