Are there any examples on the web for this? Any links would be appreciated.
Thanks.
Doing a search on google for "tcl balloon help" found several links - some
of which are:
http://www.multimania.com/droche/tkballoon/
http://www.jessikat.demon.co.uk/blnhlp.html
Also, the "Bwidget" package has a nice built-in balloon help functionality.
Hope that helps.
Jeff
"Phil Marden" <philip....@intel.com> wrote in message
news:9c4974$m...@news.or.intel.com...
> Phil,
>
> Doing a search on google for "tcl balloon help" found several links -
> some of which are:
>
> http://www.multimania.com/droche/tkballoon/
> http://www.jessikat.demon.co.uk/blnhlp.html
>
> Also, the "Bwidget" package has a nice built-in balloon help
> functionality. Hope that helps.
>
You can also find some code on the Tcl Wiki.
L
--
Some code I wrote earlier this week...
proc balloonIn {w msg} {
if {![winfo exist .balloon]} {
toplevel .balloon
wm overrideredirect .balloon 1
label .balloon.l -foreground blue -background yellow \
-highlightthick 0 -relief solid -borderwidth 1 \
-font {Helvetica -10} -textvariable balloon_text
pack .balloon.l
}
set ::balloon_text $msg
set x [expr {[winfo rootx $w]+10}]
set y [expr {[winfo rooty $w]+[winfo height $w]+5}]
set g [format +%d+%d $x $y]
# This is probably overdoing it, but better too much than too little
wm geometry .balloon $g
wm deiconify .balloon
wm geometry .balloon $g
raise .balloon
after idle "[list wm geometry .balloon $g]; raise .balloon"
}
proc balloonOut {} {
if {[winfo exist .balloon]} {
wm withdraw .balloon
}
}
# Message in $msg, balloon relative to widget $r, bind to
# widgets listed in remaining arguments.
proc bindBalloon {msg r args} {
foreach w $args {
bind $w <Enter> [namespace code [list balloonIn $r $msg]]
bind $w <Leave> [namespace code balloonOut]
}
}
### DEMO CODE ###
pack [button .b1 -text Hi -command {puts "Hello there"}]
pack [button .b2 -text Bye -command {exit}]
bindBalloon "Says a friendly message" . .b1
bindBalloon "Quits the program" . .b2
Having the separate argument for specifying which widget the balloon
is to be relative to is a great help when working with more complex
layouts - particularly pseudo-megawidgets - where you want the same
message to be bound to several different widgets.
Donal.
--
Donal K. Fellows http://www.cs.man.ac.uk/~fellowsd/ fell...@cs.man.ac.uk
-- Always running as a superuser is not a fault, it's an OS preference.
-- <mz...@hotmail.com>