Vanishing tooltips on Windows XP
Posted: Sat Jun 16, 2012 6:05 pm
Hi all,
when I have some gadgets with tooltips, after clicking at any gadget the tooltip of that gadget is not visible any more (PB 4.61 on Windows XP x86). The following demo code shows the problem:
When I move the mouse over the checkbox or its corresponding text, its tooltip appears. But when I then cklick at the checkbox, the tooltip disappears. The same happens with the buttons, for instance the "Info" button: When I cklick at the button, a message box appears. After closing the message box, and moving the mouse curser over the "Info" button again, there is no tooltip. It seems that any event related to a gadget makes the tooltip of that gadget disappear.
It seems that the issue can be fixed, by calling GadgetToolTip() not only during creation of the window, but also each time when there is an event for the respective gadget:
But I wonder whether this behaviour of the tooltips is intended.
Regards, Little John
//edit 2012-06-17: changed the thread title
when I have some gadgets with tooltips, after clicking at any gadget the tooltip of that gadget is not visible any more (PB 4.61 on Windows XP x86). The following demo code shows the problem:
Code: Select all
;-- Window
Enumeration
#Win
EndEnumeration
;-- Gadgets
Enumeration
#CheckBox
#BtnOpen
#BtnInfo
EndEnumeration
Define Event.i, file$
OpenWindow(#Win, #PB_Ignore, #PB_Ignore, 130, 70, "Tooltip demo")
CheckBoxGadget(#CheckBox, 10, 10, 70, 20, "Check me")
ButtonGadget(#BtnOpen, 10, 40, 50, 20, "Open")
ButtonGadget(#BtnInfo, 70, 40, 50, 20, "Info")
GadgetToolTip(#CheckBox, "Checkbox tip")
GadgetToolTip(#BtnOpen, "Open tip")
GadgetToolTip(#BtnInfo, "Info tip")
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case #CheckBox
Case #BtnOpen
file$ = OpenFileRequester("", "", "*.*", 0)
Case #BtnInfo
MessageRequester("Current time", FormatDate("%hh:%ii", Date()))
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
It seems that the issue can be fixed, by calling GadgetToolTip() not only during creation of the window, but also each time when there is an event for the respective gadget:
Code: Select all
;-- Window
Enumeration
#Win
EndEnumeration
;-- Gadgets
Enumeration
#CheckBox
#BtnOpen
#BtnInfo
EndEnumeration
Define Event.i, file$
OpenWindow(#Win, #PB_Ignore, #PB_Ignore, 130, 70, "Tooltip demo")
CheckBoxGadget(#CheckBox, 10, 10, 70, 20, "Check me")
ButtonGadget(#BtnOpen, 10, 40, 50, 20, "Open")
ButtonGadget(#BtnInfo, 70, 40, 50, 20, "Info")
GadgetToolTip(#CheckBox, "Checkbox tip")
GadgetToolTip(#BtnOpen, "Open tip")
GadgetToolTip(#BtnInfo, "Info tip")
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case #CheckBox
GadgetToolTip(#CheckBox, "Checkbox tip") ; <== fix
Case #BtnOpen
GadgetToolTip(#BtnOpen, "Open tip") ; <== fix
file$ = OpenFileRequester("", "", "*.*", 0)
Case #BtnInfo
GadgetToolTip(#BtnInfo, "Info tip") ; <== fix
MessageRequester("Current time", FormatDate("%hh:%ii", Date()))
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
Regards, Little John
//edit 2012-06-17: changed the thread title