Hey all,
I want to use HyperLinkGadget (or a button) to link to a web page so that clicking on it would open the web page in a new tab.
Possible?
Thanks.
Web page link
Re: Web page link
Code: Select all
Enumeration
#Window
#HyperLinkGadget
EndEnumeration
Procedure RunProgram(Filename.s, Parameter.s)
! if (v_parameter != "") {
! var win = window.open(v_filename, v_parameter);
! win.focus();
! } else {
! window.open(v_filename);
! }
EndProcedure
Procedure HyperLinkGadgetEvent()
RunProgram("http://www.spiderbasic.com", "_blank")
EndProcedure
OpenWindow(#Window, 0, 0, 270, 160, "HyperlinkGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
HyperLinkGadget(#HyperLinkGadget, 10, 10, 250,20,"Red HyperLink", RGB(255,0,0))
BindGadgetEvent(#HyperLinkGadget, @HyperLinkGadgetEvent())
Re: Web page link
Wonderful. Thank you very much Peter.
The ! indicate inline JS?
The ! indicate inline JS?
Re: Web page link
you're welcome.Jarlve wrote:Wonderful. Thank you very much Peter.
yes. It is also possible to encapsulate a JavaScript-Block with EnableJS / DisableJS,Jarlve wrote:The ! indicate inline JS?
but in this case the SpiderBasic-IDE incorrectly changes the if to If.
Greetings ... Peter
Re: Web page link
Okay, thank you for the explanation.
The color of the HyperLink text remains black. Or is that because it was already clicked? Though it does not change back to its supposed color after restarting the webpage.
Using "SetGadgetColor(5,#PB_Gadget_FrontColor,RGB(0,0,255))" as workaround.
The color of the HyperLink text remains black. Or is that because it was already clicked? Though it does not change back to its supposed color after restarting the webpage.
Using "SetGadgetColor(5,#PB_Gadget_FrontColor,RGB(0,0,255))" as workaround.
Re: Web page link
Peter, my app uses a EditorGadget and it is possible to drag the HyperLink into the gadget which removes all of the buttons and shows this text in the Editor: http://127.0.0.1:9081/SpiderBasic_Compilation0.html