Forcing Internal Help baloon popup from hotkey handler

(still can’t figure this one out)

Hi,

We have an application which users sometimes run without a mouse and
sometimes with. I want to assists users by proving case sensitive help. I’d
like to use the pop-up balloons but can’t, because they can only hold one
line of text and usually display the same text as the widget.

So I looked at using help in a balloon using the Pt_INTERNAL_HELP flag and
using the ‘?’ icon. This works great as long as users have a mouse to click
the ‘?’ icon and than the widget. But when they don’t…

In the helpfiles I have only found an example which sends a Ph_WM_HELP event
to the window from some callback, which again turns the mouse cursor into a
‘?’ . But it seems to me the user can’t apply this cursor to a specific
widget without a mouse.

How can I force a widget to display its inline help, either from:

  • a widget hotkey callback, or
  • a window hotkey callback which figures out which widget has focus

(and please don’t be too hard on my limited photon knowledge, I just
returned to Photon programming after a 5 year break :wink:

Thanks,
Onno Willems
The Netherlands

Onno Willems <Onno_Willems@hotmail.com> wrote:
[snip]

How can I force a widget to display its inline help, either from:

  • a widget hotkey callback, or
  • a window hotkey callback which figures out which widget has focus

Would any of the PtHelpXXXX routines help?

As for the focus deal, the only thing I
can think of is to use PtWidgetTree, and
PtIsFocused.

Someone else may have a more eloquent method.

Regards.

Would any of the PtHelpXXXX routines help?
Thanks, but I don’t think so.

They all seem to pop-up the helpviewer, and I want the widget to show it’s
internal help.

Any other ideas?

“Derek Leach” <dleach@qnx.com> wrote in message
news:b1rscr$s0s$1@inn.qnx.com

Onno Willems <> Onno_Willems@hotmail.com> > wrote:
[snip]
How can I force a widget to display its inline help, either from:

  • a widget hotkey callback, or
  • a window hotkey callback which figures out which widget has focus

Would any of the PtHelpXXXX routines help?

As for the focus deal, the only thing I
can think of is to use PtWidgetTree, and
PtIsFocused.

Someone else may have a more eloquent method.

Regards.

Onno Willems <Onno_Willems@hotmail.com> wrote:

Would any of the PtHelpXXXX routines help?
Thanks, but I don’t think so.

  1. Well, you would need to do a get resource on Pt_ARG_HELP_TOPIC
    to retrieve the text string, then call PtInflateBalloon.

  2. Now, when you suggest hotkeys, you need some method to identify
    what widget the cursor is over. You could try setting Pt_GETS_FOCUS
    on the relevant widgets, if it is not already, then attach a
    Pt_CB_GOT_FOCUS callback to the widgets. Create a global
    that points to the focused widget. When the user hits the
    hotkey, retrieve the widget pointer from the global reference,
    and do the help thing with it(#1).

This method seems rather wild, and I am unsure if it works, but it seems
to be a sound theory. Personally I hate globals, but I cannot
think of another method.

Regards.

They all seem to pop-up the helpviewer, and I want the widget to show it’s
internal help.

Any other ideas?

“Derek Leach” <> dleach@qnx.com> > wrote in message
news:b1rscr$s0s$> 1@inn.qnx.com> …
Onno Willems <> Onno_Willems@hotmail.com> > wrote:
[snip]
How can I force a widget to display its inline help, either from:

  • a widget hotkey callback, or
  • a window hotkey callback which figures out which widget has focus

Would any of the PtHelpXXXX routines help?

As for the focus deal, the only thing I
can think of is to use PtWidgetTree, and
PtIsFocused.

Someone else may have a more eloquent method.

Regards.

Thanks, stupid of me that I didn’t think of this myself. Guess I was
assuming the internal help was something different from the normal pop-up
balloons.

I did something like you suggested, although it’s not the most beautiful
solution. For example: normally when the internal help balloon is displayed
and you click the window, the balloon is removed automatically. What I did
is attach a hotkey callback to the window, figure out which widget has
focus, get the Pt_ARG_HELP_TOPIC and create a balloon widget.

If the balloon widget already exists (must save the pointer globally), I
simply destroy it and return, making F1 some kind of context sensitive help
toggle. Maybe not the prettiest solution in the world but it does the job.

Thanks again,
Onno


“Derek Leach” <dleach@qnx.com> wrote in message
news:b1u701$ji9$1@inn.qnx.com

Onno Willems <> Onno_Willems@hotmail.com> > wrote:
Would any of the PtHelpXXXX routines help?
Thanks, but I don’t think so.

  1. Well, you would need to do a get resource on Pt_ARG_HELP_TOPIC
    to retrieve the text string, then call PtInflateBalloon.

  2. Now, when you suggest hotkeys, you need some method to identify
    what widget the cursor is over. You could try setting Pt_GETS_FOCUS
    on the relevant widgets, if it is not already, then attach a
    Pt_CB_GOT_FOCUS callback to the widgets. Create a global
    that points to the focused widget. When the user hits the
    hotkey, retrieve the widget pointer from the global reference,
    and do the help thing with it(#1).

This method seems rather wild, and I am unsure if it works, but it seems
to be a sound theory. Personally I hate globals, but I cannot
think of another method.

Regards.

They all seem to pop-up the helpviewer, and I want the widget to show
it’s
internal help.

Any other ideas?

“Derek Leach” <> dleach@qnx.com> > wrote in message
news:b1rscr$s0s$> 1@inn.qnx.com> …
Onno Willems <> Onno_Willems@hotmail.com> > wrote:
[snip]
How can I force a widget to display its inline help, either from:

  • a widget hotkey callback, or
  • a window hotkey callback which figures out which widget has focus

Would any of the PtHelpXXXX routines help?

As for the focus deal, the only thing I
can think of is to use PtWidgetTree, and
PtIsFocused.

Someone else may have a more eloquent method.

Regards.