Page 1 of 1

Webgadget and Google

Posted: Tue Sep 12, 2023 10:27 am
by jak64
Hello,
Hello everyone,
I create a WebGadget by launching Google.

My question :
How to send a string to Google's search box and send it

Here is the snippet of code used (from Purebasic help)

Code: Select all

If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
  WebGadget(0, 10, 10, 580, 280, "https://www.google.com") 
  Repeat 
  Until WaitWindowEvent() = #PB_Event_CloseWindow 
EndIf
view the photo.

thank you

Image

Re: Webgadget and Google

Posted: Tue Sep 12, 2023 12:04 pm
by BarryG
Like this?

Code: Select all

If OpenWindow(0, 0, 0, 1000, 900, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
  WebGadget(0, 10, 10, 980, 880, "https://www.google.com/search?q=jak64") 
  Repeat 
  Until WaitWindowEvent() = #PB_Event_CloseWindow 
EndIf

Re: Webgadget and Google

Posted: Tue Sep 12, 2023 2:11 pm
by Allen
Hi,

You can use SetGadgetText() to set the URL. More info can be found in the WebGadget help file.

Code: Select all

If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
  WebGadget(0, 10, 10, 580, 280, "https://www.google.com") 
  SetGadgetText(0,"https://www.purebasic.fr/english/viewtopic.php?t=82424")
  Repeat 
  Until WaitWindowEvent() = #PB_Event_CloseWindow 
EndIf
Thanks

Allen

Re: Webgadget and Google

Posted: Tue Sep 12, 2023 2:34 pm
by jak64
Hello Allen,
It's OK. :idea:

Thanks to you