Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BalloonHelp by Jeff Hobbs not working for menus

6 views
Skip to first unread message

Helmut Giese

unread,
Mar 18, 2006, 2:21:58 PM3/18/06
to
Hello out there,
my users don't read manuals. I put small descriptions of the menu
entry's purposes onto the status bar, but they don't know to look
there. Besides, some of the functions are a bit too complex to explain
in the little space a status bar provides.

So I thought "Tooltips aka Balloon Help" to the rescue. There are lots
of examples on the wiki, but they don't seem to be designed for menu
items: They want widgets and all I have is a menu and some indices.

The DynamicHelp from BWidgets claims to work for menus (and there is
even an example provided in its man page), but I didn't get it to
work.

Jeff Hobbs' BalloonHelp package describes how to attach it to menu
entries, too - but it didn't work either. (BTW I got the latest
version from SF.)

Probably I am doing something wrong. I attach a small example using
Jeff's BalloonHelp. The help shows up for the button, but I don't see
anything for the menus.
This is Tcl 8.4.9 on Windows XP.

Any help - with BWidgets' DynamicHelp or Jeff's BalloonHelp or
anything else - will be muchos appreciated - this has been one these
days full of no progress :(
Thanks and best regards
Helmut Giese
---
package require Tk
package require BWidget

# just a quick hack: don't have a pkgIndex.tcl
source BalloonHelp.tcl
package require BalloonHelp

set menu {
"&File" {} {0} 0 {
{command "&Open" {} "" {} -command fOpen}
{command "&Save" {} "" {} -command fSave}
{separator}
{command "&Quit" {} "" {} -command closeDown}
}
}

pack [MainFrame .sdk -menu $menu]
# let's add a button
pack [button .btn -text "Click me"]

# using BWidget we have gotten '.menubar.0' for the file menu
# BalloonHelp seems to find it - there is no complaint
balloonhelp .menubar.0 -index 0 "File: help text for index 0"
balloonhelp .menubar.0 -index 1 "File: help text for index 1"
# now for the button
balloonhelp .btn "Click me - that's my destiny."
---

mdn

unread,
Mar 19, 2006, 4:18:16 AM3/19/06
to
Hi,

I don't know about the BalloonHelp package, but there might not be
balloon help for menu entries in BWidget; the manpage mentions under
register: "For menu, balloon type help is not available." I wouldn't be
surprised if that still holds, even though register is deprecated. You
can slam something together yourself though:

package require BWidget

proc simpleBalloon {args} {
global varinfo
if { $varinfo eq "" } {
destroy .sb
return
}
if { ![winfo exists .sb] } {
toplevel .sb
foreach {x y} [winfo pointerxy .sb] break
incr x 10
wm geometry .sb +$x+$y
wm overrideredirect .sb 1
pack [label .sb.l -text "$varinfo" -bg yellow]
} else {
.sb.l configure -text "$varinfo"
}
}

pack [frame .f]
pack [button .f.b -text "Click me" -command {puts "Hello World"}]
trace add variable varinfo write simpleBalloon
menu .m
menu .m.file
.m add cascade -menu .m.file -label "File"
.m.file add command -label "Quit" -command {destroy .}
. configure -menu .m
DynamicHelp::add .m.file -type menu -variable varinfo
DynamicHelp::add .m.file -type menu -index 0 -text "Detach menu"
DynamicHelp::add .m.file -type menu -index 1 -text "Close window"


Helmut Giese schreef:

Helmut Giese

unread,
Mar 19, 2006, 10:27:14 AM3/19/06
to
On Sun, 19 Mar 2006 10:18:16 +0100, mdn <m.d....@hetnet.nl> wrote:

Hi,
>I don't know about the BalloonHelp package, but there might not be
>balloon help for menu entries in BWidget; the manpage mentions under
>register: "For menu, balloon type help is not available." I wouldn't be

yeah, I read that , too, but then on the DynamicHelp page there is a
description how to accomplish 'something' for menus. I don't know what
'something' is supposed to look like, since I didn't see anything.

>surprised if that still holds, even though register is deprecated. You
>can slam something together yourself though:

Thanks a lot, this is a start. It will need some twiddling for the
correct placement - on my screen the .sb toplevel is partially
obscured by its menu item - but having a nice, small example like
yours is something I can build on.

[snip example showing how easy some things could be - for someone
GUI-savvy]

Thanks again and best regards
Helmut Giese

Helmut Giese

unread,
Mar 19, 2006, 10:59:06 AM3/19/06
to
On Sat, 18 Mar 2006 19:21:58 GMT, hgi...@ratiosoft.com (Helmut Giese)
wrote:

A small follow-up: Reading the subject line today I suddenly felt that
mentioning Jeff there might be misunderstood as some sort of critique
or such - something like 'Hey look, this guy's code doesn't work.'.

I want to make clear that this was not at all my intention. I am very
grateful for the work Jeff does for Tcl and the community at large and
I apologize for any wrong impression the above subject line might have
given.

This said, I can add a - technical - detail: The balloon help _does_
show up - on the upper left corner of the screen. Seems like one side
is supplying (application) relative coordinates and some other side
interpretes them as (screen) absolute coordinates.
And another observation:
- Go to the first item (open) - nothing
- Go to the second item (save) - help shows
- Go back to the first - now help shows there, too

It's always intriguing, how many smallish things there are which can
break, sigh.

The next 2 days I'll be busy catching up on some neglected work and
then I'll have another go at the fascinating world of 'How to put a
balloon help at just the right position wrt a menu item'.
Best regards
Helmut Giese

Gerald W. Lester

unread,
Mar 19, 2006, 2:28:21 PM3/19/06
to
Helmut Giese wrote:
> ...

> Probably I am doing something wrong. I attach a small example using
> Jeff's BalloonHelp. The help shows up for the button, but I don't see
> anything for the menus.
> This is Tcl 8.4.9 on Windows XP.

Tk menus on Microsoft Windows use the native menu system -- thus BWidgets'
DynamicHelp or Jeff's BalloonHelp will not work since they only work on
"real Tk widgets".

I do not think that the naive menu system on MS Windows provides for any
type of balloon help -- in fact I think this is against the MS Windows style
guide.

In short you are up against the problem of Tk looking and acting in a native
way as opposed to a platform independent way.

>...

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

Helmut Giese

unread,
Mar 19, 2006, 2:47:58 PM3/19/06
to
On Sun, 19 Mar 2006 13:28:21 -0600, "Gerald W. Lester"
<Gerald...@cox.net> wrote:

>Helmut Giese wrote:
>> ...
>> Probably I am doing something wrong. I attach a small example using
>> Jeff's BalloonHelp. The help shows up for the button, but I don't see
>> anything for the menus.
>> This is Tcl 8.4.9 on Windows XP.
>
>Tk menus on Microsoft Windows use the native menu system -- thus BWidgets'
>DynamicHelp or Jeff's BalloonHelp will not work since they only work on
>"real Tk widgets".

Hi Gerald,
maybe that's the reason for BWidgets' DynamicHelp not showing anything
for menus.
However, Jeff's BalloonHelp _does_ show up for menus, too - only at
the wrong place (see my follow-up to myself in this thread). So there
is a way to get it done.

>I do not think that the naive menu system on MS Windows provides for any
>type of balloon help -- in fact I think this is against the MS Windows style
>guide.

No, Windows certainly doesn't _provide_ anything in this direction.
And 'against the style guide'? Well, maybe, I don't know, but until I
have a better idea how to transport some information to the 'unwilling
to read anything' users, I'll stick to this - it's the best I could
think of so far. (Anybody knows a better way? Let's hear it.)

Thanks for your thoughts and best regards
Helmut Giese

Gerald W. Lester

unread,
Mar 19, 2006, 3:44:55 PM3/19/06
to
Helmut Giese wrote:
>
> And 'against the style guide'? Well, maybe, I don't know, but until I
> have a better idea how to transport some information to the 'unwilling
> to read anything' users, I'll stick to this - it's the best I could
> think of so far. (Anybody knows a better way? Let's hear it.)

I agree, the comment about the style guide was in relation as to windows not
providing -- I'll leave it to speculation as which is the cause and which is
the effect (my vote is the style guide is the effect rather than the cause).

0 new messages