How to use a custom color gadget (jscolor)
Posted: Sun Mar 19, 2017 11:03 pm
Hi all,
I was making a GUI until i realised theres no colorgadget...
My question is: How to use a custom color gadget like jscolor?
link: http://jscolor.com/
My attempts end on nothing.
With a webgadget it works as expected, but how to use it wthout a webgadget so i can use it besides the other spiderbasic gadgets?
And if that works, how to give it a X and Y location?
I was making a GUI until i realised theres no colorgadget...
My question is: How to use a custom color gadget like jscolor?
link: http://jscolor.com/
My attempts end on nothing.
With a webgadget it works as expected, but how to use it wthout a webgadget so i can use it besides the other spiderbasic gadgets?
And if that works, how to give it a X and Y location?
Code: Select all
Procedure GadgetEvents()
Select EventGadget()
; ------------------------------
;Case 1 ;
; ------------------------------
EndSelect
EndProcedure
If OpenWindow(0, 0, 0, 450, 550, "", #PB_Window_Background)
; text gadgets
TextGadget(0, 20, 40, 150, 25, "Color", #PB_Text_VerticalCenter)
;WebGadget(10, 20, 20, 300, 200, "jscolor.html")
; how to use this without using a webgadget?
! <script src="jscolor.js"></script>
! Color: <input class="jscolor" value="ab2567">
CloseGadgetList()
; ------------------------------------------------------------------------------------------------------
BindEvent(#PB_Event_Gadget, @GadgetEvents())
CompilerIf #PB_Compiler_OS <> #PB_OS_Web
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
CompilerEndIf
EndIf