[EDIT] 02/20/26 More ultimate than any posted here so far. This uses an include file as the engine to create and edit the BalloonTip. See it here: viewtopic.php?p=651836#p651836
[OLD/OBSOLETE EDIT] Go to my next post for more proper solution. This first post just illustrates over thinking the problem.
Kind of embarrassing.
[OLD/OBSOLETE EDIT] =2/18/26 -- Better yet, go here for an even better solution{ viewtopic.php?p=651787#p651787
I suspect some here have a more sophisticated way to do this but this works for me. I wanted to get tootips by hovering on various gadgets and it may not be pretty but it works:
Code: Select all
EnableExplicit
Define Event
Dim Disc.s(10) ; Gadget description Array
Enumeration
#Gad0
#Gad1
#Gad2
#Gad3
#Gad4
#Gad5
EndEnumeration
;EXTRA SPACE HERE VVVVVV MOVES TEXT TO RIGHT OFTHE MOUSE POINTER So you can read the text
Disc(#Gad0) = "` LISTBOX #0"
Disc(#Gad1) = "` Button #1"
Disc(#Gad2) = "` Button #2"
Disc(#Gad3) = "` STRING #3"
Disc(#Gad4) = "` STRING #4"
OpenWindow(0, 100, 100, 320, 200, "REAL Hover Test")
ListViewGadget(#Gad0,5,5,200,60)
ButtonGadget(#Gad1, 40, 70, 100, 30, "Button 1")
ButtonGadget(#Gad2, 180, 70, 100, 30, "Button 2")
StringGadget(#Gad3,49,110,100,30,"")
StringGadget(#Gad4,49,155,100,30,"")
AddWindowTimer(0, 1, 300)
Global lastID = -1
Global pt.POINT
Global hwnd
Global id
Repeat
event = WaitWindowEvent()
Select Event
Case #PB_Event_Timer
GetCursorPos_(pt) ;<<<< Save energy -- Wait for timer to test mouse position
hwnd = WindowFromPoint_(PeekQ(@pt)) ; POINT passed as 64-bit
If hwnd
id = GetDlgCtrlID_(hwnd) ; Convert Win Handle to gadget ID Number
Debug GetDlgCtrlID_(hwnd)
EndIf
Select id
Case #Gad0 To #Gad4 ; ONLY acknowledge our gadgets
GadgetToolTip(id,Disc(id))
EndSelect
EndSelect
Until event = #PB_Event_CloseWindow
