[squeak-dev] triggering URLs from Squeak (was Re: trunk and new vm etiquette)

Jakob Reschke forums.jakob at resfarm.de
Wed Jul 22 18:31:33 UTC 2020


In my image I have wired this for Windows to ShellExecute via FFI. One
could put it in a plugin as well.

Object subclass: #ExternalWindowsWebBrowser
   instanceVariableNames: ''
   classVariableNames: ''
   poolDictionaries: ''
   category: 'jr'

initialize
   "ExternalWindowsWebBrowser initialize"
   WebBrowser register: self.

openOnUrl: aUrl
   ShellExecute execute: aUrl asString.

Object subclass: #ShellExecute
   instanceVariableNames: ''
   classVariableNames: ''
   poolDictionaries: ''
   category: 'jr'

execute: aString
   self assert: aString isString.
   ^ self apiShellExecuteForWindow: nil
      operation: nil
      file: aString
      parameters: nil
      directory: nil
      show: 5 "SW_SHOW"

apiShellExecuteForWindow: hwnd operation: operationString file:
fileString parameters: parametersString directory: directoryString
show: aBitfieldInteger
   <apicall: void* 'ShellExecuteA' (void* char* char* char* char*
long) module: 'Shell32.dll'>
   ^ self externalCallFailed


Am Mi., 22. Juli 2020 um 19:34 Uhr schrieb tim Rowledge <tim at rowledge.org>:
>
>
>
> On 2020-07-22, at 7:43 AM, Marcel Taeumel <marcel.taeumel at hpi.de> wrote:
>
> Hi Eliot,
>
> looks good. In "About Squeak", we point to "Visit https://github.com/OpenSmalltalk/opensmalltalk-vm".
>
>
> That reminds me; currently the system would complain about o web browser and offer this -
>
> We can do better, for certain probably interesting definitions of the word 'better'. In Scratch we use the ScratchPlugin primitive primOpenURL: and that defers to platform code within the plugin. In unix-land it uses the slightly scary xdg-open facility; I have no idea what the equivalent might be for other platforms but surely it must be doable.
>
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> I am still waiting for the advent of the computer science groupie.
>
>
>


More information about the Squeak-dev mailing list