analogue GetDlgCtrlID ()

Linux specific forum
mestnyi
Addict
Addict
Posts: 1102
Joined: Mon Nov 25, 2013 6:41 am

analogue GetDlgCtrlID ()

Post by mestnyi »

how to get the id in Linux by Hendle?
mestnyi
Addict
Addict
Posts: 1102
Joined: Mon Nov 25, 2013 6:41 am

Re: analogue GetDlgCtrlID ()

Post by mestnyi »

Wrong wrote, please insert topic of Linux
User avatar
idle
Always Here
Always Here
Posts: 6026
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: analogue GetDlgCtrlID ()

Post 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   
Windows 11, Manjaro, Raspberry Pi OS
Image
User avatar
Bisonte
Addict
Addict
Posts: 1320
Joined: Tue Oct 09, 2007 2:15 am

Re: analogue GetDlgCtrlID ()

Post 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 ?
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: analogue GetDlgCtrlID ()

Post by ts-soft »

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Bisonte
Addict
Addict
Posts: 1320
Joined: Tue Oct 09, 2007 2:15 am

Re: analogue GetDlgCtrlID ()

Post 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.
PureBasic 6.21 (Windows x64) | Windows 11 Pro | AsRock B850 Steel Legend Wifi | R7 9800x3D | 64GB RAM | RTX 5080 | ThermaltakeView 270 TG ARGB | build by vannicom​​
English is not my native language... (I often use DeepL.)
Post Reply