Hi Bob,
Thanks for the prompt reply. I was able to fix the problem I was having with the limitation on my pop-up. I found a the balloon.tcl example code and it worked great.
Actually, now I am having trouble with the positioning of my balloonhelp labels.I have a hand full of lengthy balloons and it appears that as some of the buttons closer to the bottom of my top level gui will not display the long balloons.
Below is the code I am using for the balloon popup, in balloonhelp_show I am trying to get the coordinates of my tlg (using the parent option) and add 1/4 of x coordinate and 1/2 of the y coordinate to place my balloon help somewhere in the middle of the gui. Basically what I am trying to do is make sure that the balloon label does not go off of the display window no matter how close the button in the tlg is to the edge of the screen. I have done this before for menubutton using the -direction below command but I am having trouble for this label.
+++++++++++++++++++++++++++++++++++++++++++
bind bhInfo <Enter> {
set bhInfo(set) 0
set bhInfo(first) 1
set bhInfo(id) [after 500 {balloonhelp_show %W $bhInfo(%W) %X %Y}]
}
bind bhInfo <Button> {
set bhInfo(first) 0
balloonhelp_cancel
}
bind bhInfo <Leave> {
set bhInfo(first) 0
balloonhelp_cancel
}
bind bhInfo <Motion> {
if {$bhInfo(set) == 0} {
after cancel $bhInfo(id)
set bhInfo(id) [after 500 {balloonhelp_show %W $bhInfo(%W) %X %Y}]
}
}
################################################################################
##
## Function Name: balloonhelp_for
##
## Inputs:
## win - window name
## mesg - text for balloon help
##
## Outputs:
##
## Description:
## Adds balloon help to the widet named <win>. Whenever the mouse
## pointer enters this widget and rests within it for a short delay,
## a balloon help window will automatically appear showing the help
## <mesg>.
##
################################################################################
proc balloonhelp_for {win mesg} {
global bhInfo
set bhInfo($win) $mesg
bindtags $win "[bindtags $win] bhInfo"
#bind $win <Enter> {balloonhelp_pending %W %x %y}
#bind $win <Leave> {balloonhelp_cancel}
}
# ----------------------------------------------------------------------
# USAGE: balloonhelp_cancel
#
# Used internally to mark the point in time when the mouse pointer
# leaves a widget. Cancels any pending balloon help requested earlier
# and hides the balloon help window, in case it is visible.
# ----------------------------------------------------------------------
proc balloonhelp_cancel {} {
global bhInfo
after cancel $bhInfo(id)
if {[winfo exists .balloonhelp] == 1} {
destroy .balloonhelp
}
set bhInfo(set) 0
}
# ----------------------------------------------------------------------
# USAGE: balloonhelp_show <win x y>
#
# Used internally to display the balloon help window for the
# specified <win>.
# ----------------------------------------------------------------------
proc balloonhelp_show {win message {cx 0} {cy 0} } {
global bhInfo
if { ($bhInfo(first) == 1) } {
set bhInfo(first) 2
#tk_dialog .dialog_msg "ERROR Message" \
"win = $win\n\
win parent = [winfo parent $win]" \
"" 0 OK;
if { $cx == 0 && $cy == 0 } {
set x [expr [winfo rootx $win] + ([winfo width $win]/2)]
set y [expr [winfo rooty $win] + [winfo height $win] + 4]
#tk_dialog .dialog_msg "ERROR Message" \
"cx = $cx\ncy = $cy" \
"" 0 OK;
} else {
#tk_dialog .dialog_msg "ERROR Message" \
"cx = $cx\ncy = $cy" \
"" 0 OK;
set x [expr [winfo rootx [winfo parent $win]] + ([winfo width [winfo parent $win]]/4)]
set y [expr [winfo rooty [winfo parent $win]] + ([winfo height [winfo parent $win]]/2)]
#tk_dialog .dialog_msg "ERROR Message" \
"[expr [winfo height [winfo parent $win]]/3]" \
"" 0 OK;
#set x [expr $cx + 4]
#set y [expr $cy + 4]
}
}
toplevel .balloonhelp -borderwidth 1 -bg black -screen [winfo screen $win]
wm overrideredirect .balloonhelp 1
label .balloonhelp.info \
-text $message -relief flat \
-bg LemonChiffon -fg black \
-justify left -padx 2 -pady 0 -anchor c \
-font -*-courier-bold-i-normal-sans-*-170-*
pack .balloonhelp.info -side left -fill y
wm geometry .balloonhelp +${x}+${y}
set bhInfo(set) 1
}
+++++++++++++++++++++++++++++++++++++++++++
thanks,
Oliver