Page 1 of 1

analogue GetDlgCtrlID ()

Posted: Tue Feb 25, 2014 8:42 pm
by mestnyi
how to get the id in Linux by Hendle?

Re: analogue GetDlgCtrlID ()

Posted: Wed Feb 26, 2014 7:11 pm
by mestnyi
Wrong wrote, please insert topic of Linux

Re: analogue GetDlgCtrlID ()

Posted: Wed Feb 26, 2014 7:53 pm
by idle
To get a pb gadget number from a gadgetID
you will need to set a named property for the gadget

Code: Select all

Procedure SetOSGadgetID(gadget)  
   CompilerIf #PB_Compiler_OS = #PB_OS_Linux   
       g_object_set_data_(GadgetID(gadget),"OSGadgetID",Gadget))   
   CompilerElseIf #PB_Compiler_OS = #PB_OS_Windows
       SetProp_(GadgetID(gadget),"OSGadgetID",Gadget) 
   CompilerEndIf   
EndProcedure    
 
Procedure GetOSGadgetID(OSGadgetID)  
   CompilerIf #PB_Compiler_OS = #PB_OS_Linux   
      ProcedureReturn  g_object_get_data_(OSGadgetID,"OSGadgetID")
   CompilerElseIf #PB_Compiler_OS = #PB_OS_Windows
      ProcedureReturn GetProp_(OSGadgetID,"OSGadgetID")
   CompilerEndIf    
EndProcedure   

Re: analogue GetDlgCtrlID ()

Posted: Wed Feb 26, 2014 10:10 pm
by Bisonte
idle wrote:To get a pb gadget number from a gadgetID
you will need to set a named property for the gadget

Code: Select all

Procedure SetOSGadgetID(gadget)  
   CompilerIf #PB_Compiler_OS = #PB_OS_Linux   
       g_object_set_data_(GadgetID(gadget),"OSGadgetID",Gadget))   
   CompilerElseIf #PB_Compiler_OS = #PB_OS_Windows
       SetProp_(GadgetID(gadget),"OSGadgetID",Gadget) 
   CompilerEndIf   
EndProcedure    
 
Procedure GetOSGadgetID(OSGadgetID)  
   CompilerIf #PB_Compiler_OS = #PB_OS_Linux   
      ProcedureReturn  g_object_get_data_(OSGadgetID,"OSGadgetID")
   CompilerElseIf #PB_Compiler_OS = #PB_OS_Windows
      ProcedureReturn GetProp_(OSGadgetID,"OSGadgetID")
   CompilerEndIf    
EndProcedure   
Nice... Now I know the Set/GetProp... for Linux. Is there a variant for MacOs ?

Re: analogue GetDlgCtrlID ()

Posted: Wed Feb 26, 2014 10:24 pm
by ts-soft

Re: analogue GetDlgCtrlID ()

Posted: Wed Feb 26, 2014 10:30 pm
by Bisonte
ts-soft wrote:Here, crossplattform without API: http://www.purebasic.fr/german/viewtopi ... 68#p319468
This one I know ;)
But I wanted to know the "API" way for MacOS .... like SetProp_() for windows.