Page 1 of 1

WebGadget: Open Link in New Window does not work...

Posted: Fri Sep 06, 2024 10:23 am
by flashbob
PB 6.10: Using WebGadget on MAC I have following behaviour:

1. the popup menu appears in english and not in system language.
2. Popup menu "Open Link in New Window" does not work

Here an example code:

Code: Select all

; Popup menu "Open Link in New Window" does not work...

EnableExplicit

Enumeration FormGadget
  #web_gadget
EndEnumeration

Define event
Define HtmlCode$= "<html><body><div contenteditable>" +
                      "My Link: <a href= 'https://www.purebasic.com'>www.purebasic.com</a>"+
                  "</div></body></html>"

OpenWindow(0, 0, 0, 600, 400, "WebGadget", #PB_Window_SystemMenu)
WebGadget(#web_gadget, 0, 5, 600, 400, "")
SetGadgetItemText(#web_gadget, #PB_Web_HtmlCode, HtmlCode$)

Repeat
  event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
Any ideas ? Thx

Re: WebGadget: Open Link in New Window does not work...

Posted: Fri Sep 06, 2024 10:31 am
by Fred
Unless I miss something, there is no new window, it's not a browser.

Re: WebGadget: Open Link in New Window does not work...

Posted: Fri Sep 06, 2024 3:04 pm
by flashbob
The menu item (right mouse) "Open Link" works. Why an entry "Open Link in new window" if it doesn't work?

And why do the menu items (pop-up) appear in English and not in the system language?

Re: WebGadget: Open Link in New Window does not work...

Posted: Fri Sep 06, 2024 3:24 pm
by Fred
We use the standard popup menu here (ie: we don't create one), so I don't know why the language is like that. Open link obviously work because it's like clikcing on a link. Open in a new window would requier an additional webgadget() to display the result.

Re: WebGadget: Open Link in New Window does not work...

Posted: Fri Sep 06, 2024 5:29 pm
by flashbob
... hmmm, an additional new window and webgadget doesn't make sense, since I might then need a new window in the second window, etc....

I think the best workaround is to suppress the standard popup, create my own popup in the correct language and open the marked link in an external browser (e.g. FireFox). The default popup from WebGadget makes no sense here...

Re: WebGadget: Open Link in New Window does not work...

Posted: Fri Sep 06, 2024 6:55 pm
by Fred
Well you can file a report on apple radar 8)

Re: WebGadget: Open Link in New Window does not work...

Posted: Fri Sep 06, 2024 11:55 pm
by flashbob
I don't think this is an Apple problem !

1. I use two different browsers on MAC, both show the same Popup and the correct language. WebGadget can't do that. I don't know why you use english.
2. If the WebGaget does not support all menu items, then they should not be displayed. Otherwise a popup item makes no sense.

The webgadget is not well implemented at this point. Functions (menu item "open Link...") are provided, but they do not work.

So this has nothing to do with Apple or Windows... It's a Problem of PB/WebGadget()