It is currently Sun May 31, 2020 2:27 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Is it possible to set callback function for gadget [SOLVED]
PostPosted: Fri Mar 02, 2007 10:41 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Jan 30, 2007 5:47 am
Posts: 335
Location: Hong Kong
I see codes for setting callback function to window.
Is it possible to set callback function for gadget :?:


Last edited by SkyManager on Sat Mar 03, 2007 12:45 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 02, 2007 12:00 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Sep 15, 2003 5:55 am
Posts: 1342
Code:
Global Gadget

Procedure GadgetCallback(hWnd, uMsg, wParam, lParam)
  If uMsg = #WM_LBUTTONDBLCLK
    Debug "Double Clicked!"
  EndIf
  ProcedureReturn CallWindowProc_(Gadget, hWnd, uMsg, wParam, lParam)
EndProcedure

If OpenWindow(0, 0, 0, 150, 75, "Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
  ButtonGadget(0, 5, 5, 125, 25, "Double Click Me!")
  Gadget = SetWindowLong_(GadgetID(0), #GWL_WNDPROC, @GadgetCallback())
  Repeat
    WinEvent = WaitWindowEvent()
  Until WinEvent = #PB_Event_CloseWindow
EndIf : End


hope this helps. :wink:

c ya,
nco2k

_________________
If OSVersion() = #PB_OS_Windows_ME : End : EndIf


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Mar 02, 2007 12:53 pm 
Offline
Enthusiast
Enthusiast

Joined: Tue Jan 30, 2007 5:47 am
Posts: 335
Location: Hong Kong
Great, it helps me a lot. :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye