Webgadget and Google

Just starting out? Need help? Post your questions and find answers here.
jak64
Enthusiast
Enthusiast
Posts: 619
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Webgadget and Google

Post 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
BarryG
Addict
Addict
Posts: 4122
Joined: Thu Apr 18, 2019 8:17 am

Re: Webgadget and Google

Post 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
Allen
Enthusiast
Enthusiast
Posts: 103
Joined: Wed Nov 10, 2021 2:05 am

Re: Webgadget and Google

Post 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
jak64
Enthusiast
Enthusiast
Posts: 619
Joined: Sat Aug 15, 2020 5:02 pm
Location: Ciboure (France)

Re: Webgadget and Google

Post by jak64 »

Hello Allen,
It's OK. :idea:

Thanks to you
Post Reply