The callbacks I have been able to identify, from webgl back into J are: (1) a resize event on the parent. This happens once, initially and frequently when the parent window is resided with the mouse.
(2) A "curl" event on the webview child which happens initially when J's bin/dummy.html file is fetched. This file does not exist and some experiments creating the file suggests that it's also ignored (though perhaps that's because I have not stumbled on its purpose). (3) A "load" event on the webview child which happens after that curl event. (4) A close event on the parent. I haven't found any callbacks useful for exchanging information between J and the webview client. No key events, no mouse events, no console log events, etc. I have not figured out how to generate additional "load" events. That said, webview seems like it would be a desirable target, because it standardizes opengl support across a variety of platforms. This would presumably mean having the host environment (J) talking to the webview javascript environment. Without that, there's no clean way of updating the webview environment, nor in receiving user interaction from that environment. One alternative here might be to create a webserver in J which webview interacts with (perhaps a jhs variant, though possibly being run from within jqt). This would involve significant overhead but it might work... Frustrating, ... -- Raul On Thu, Jan 12, 2023 at 1:25 PM Raul Miller <[email protected]> wrote: > > Webgl implements callbacks for javascript events, but unless special > steps were taken that would not create an interface with the hosting J > environment. > > -- > Raul > > On Thu, Jan 12, 2023 at 7:04 AM bill lam <[email protected]> wrote: > > > > webview widget should support javascript and callback. But it has been too > > long since it has been implemented so that I forget everything about it. > > > > > > On Thu, Jan 12, 2023 at 6:55 PM Raul Miller <[email protected]> wrote: > > > > > A related question here: > > > > > > Do we have some way of piping data from J into a webgl context? > > > > > > I threw together https://rosettacode.org/wiki/WebGL_rotating_F#J and > > > it seems odd that we have a nearly fully functional environment here, > > > but no code examples which would let J pipe data into that sort of an > > > animation (nor extract data, such as a "texture" for that matter). > > > > > > Maybe I'm expecting too much? > > > > > > Thanks, > > > > > > > > > -- > > > Raul > > > > > > On Thu, Jan 12, 2023 at 2:51 AM Raul Miller <[email protected]> wrote: > > > > > > > > Oops... either remove the 'bind' keyword on the second line of that > > > > gist or assign the resulting verb a name so that it can be run... > > > > > > > > (I can't edit a gist without changing its url...) > > > > > > > > Thanks, > > > > > > > > -- > > > > Raul > > > > > > > > On Thu, Jan 12, 2023 at 2:42 AM Raul Miller <[email protected]> > > > wrote: > > > > > > > > > > https://gist.github.com/rdm/53fbfe2d34e2f8ef22db97b2fd8a8510 > > > > > > > > > > J's webgl implementation under qt requires use of javascript. > > > > > > > > > > But, in this context, while we can see that it works, the console.log > > > > > mechanism which would normally be used to debug the javascript doesn't > > > > > seem to do anything. > > > > > > > > > > Is there a way of getting console.log here to act like a J echo? > > > > > > > > > > Thanks, > > > > > > > > > > -- > > > > > Raul > > > ---------------------------------------------------------------------- > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
