Page 1 of 1

String in data Windows and Gadgets

Posted: Thu Mar 01, 2018 10:50 am
by falsam
This code works with PureBasic. Would it be possible to have the same result with SpiderBasic?

Code: Select all

OpenWindow(0, 0, 0, 800, 600, "Test", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)

SetWindowData(0, @"Value in data object")

Debug PeekS(GetWindowData(0))

CompilerIf #PB_Compiler_OS <> #PB_OS_Web
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
CompilerEndIf
Thanks ^-^

Re: String in data Windows and Gadgets

Posted: Thu Mar 01, 2018 11:17 am
by Peter
+1

that would be very helpful.

Greetings ... Peter

Re: String in data Windows and Gadgets

Posted: Tue Jul 03, 2018 2:05 pm
by poshu

Code: Select all

Procedure SetWindowString(Window,String.s)
	!spider_SetWindowData(v_window,v_string);
EndProcedure

Procedure.s	GetWindowString(Window)
	!return spider_GetWindowData(v_window);
EndProcedure

OpenWindow(1,10,10,200,200,"nya")
SetWindowString(1,"test")
Debug GetWindowString(1)
Javascript isn't typed, so anything like this is usually PB inheritance; good news though : you can just circumvent it the easy way :p