One button with a hand cursor and the other a classic button with an arrow
Posted: Tue Oct 24, 2023 12:54 pm
How can I improve this code so that a hand cursor appears over one button and a classic cursor (arrow) appears over the other button? In my code, even though "SetClassLongPtr_(GadgetID(1)" is set to only for one button, the hand cursor appears over both buttons.
Code: Select all
EnableExplicit
If OpenWindow(0, 0, 0, 500, 170, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(1, 20, 50, 200, 28, "Button with hand cursor", 0)
ButtonGadget(2, 252, 50, 230, 28, "Button without hand cursor", 0)
SetClassLongPtr_(GadgetID(1), #GCL_HCURSOR, LoadCursor_(0, #IDC_HAND))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
EndSelect
ForEver
EndIf