summaryrefslogtreecommitdiff
path: root/examples/button.tk
blob: c7809baf6477f3809fca922b23454d589357466f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/wish
load ../src/libtclivy.so.3.6

proc connect { client action } { }
proc send { } {
  global tosend
  Ivy::send $tosend
}

proc dotext {client text} {
  global tosend
  set tosend $text
  puts "text to send set to $text"
}

Ivy::init "TCLTK" "TCLTK Ready" connect connect
Ivy::start 127.255.255.255:2010
Ivy::bind "^Ivy Button text=(.*)" dotext
set tosend foo
button .send -command send -text "send msg"
pack .send