Interact or communicate between 2 webgadgets
Posted: Mon Jul 28, 2008 12:12 am
You can communicate or interact with 2 webgadgets (or even between a webgadget and iexplorer) in a very simple way.
Maybe this trick is not new for everybody, but i put it here to show how simple it is for the people that could find it usefull.
Maybe this trick is not new for everybody, but i put it here to show how simple it is for the people that could find it usefull.
Code: Select all
xHtml$ + "<script>window.name='abc'</script>" ;Gives the webgadget some name
;Code for the other webgadget
xHtml1$ = "<a href='http://www.google.com' target='abc'>Direct the other webgadget to Google</a> <br> "
xHtml1$ + "<a href='http://www.purebasic.com' target='abc'>Direct the other webgadget to PureBasic site</a> <br> "
xHtml1$ + "<a href='http://www.yahoo.com' target='abc'>Direct the other webgadget to Yahoo</a> <br> "
If OpenWindow(0,100,50,600,600,"Communicate 2 webgadgets",#PB_Window_SystemMenu)
CreateGadgetList(WindowID(0))
WebGadget(0,0,0,600,300,"about:" + xHtml$)
WebGadget(1,0,305,600,295,"about:" + xHtml1$)
Repeat
EventID=WaitWindowEvent()
Select EventID
Case #PB_Event_Gadget
Select EventGadget()
Case 2
EndSelect
EndSelect
Until EventID=#PB_Event_CloseWindow
EndIf