[racket] Adding a new native GUI component — is it possible?

From: Roman Klochkov (kalimehtar at mail.ru)
Date: Thu Dec 11 05:02:50 EST 2014

 Look at  http://planet.racket-lang.org/package-source/Dima_/Tray.plt/1/0/main.rkt

You can get GTK/win32/cocoa handle from any widget via get-handle ( http://docs.racket-lang.org/gui/window___.html#%28meth._%28%28%28lib._mred%2Fmain..rkt%29._window~3c~25~3e%29._get-handle%29%29 )

Wed, 10 Dec 2014 21:35:54 -0800 от Alexis King <lexi.lambda at gmail.com>:
>The Racket GUI system is nice, but as with almost any GUI system, sometimes I yearn for the simplicity of HTML rendering. CSS and JavaScript let properly-styled HTML be easily inserted into almost any application without anyone realizing it isn’t native, so long as it’s fast and seamless.
>Basically, I want to try and create a wrapper for a  Chromium web view  to be able to add to a Racket GUI in the same way that I can add, say, a horizontal-panel%. However, even putting the logistics of the complications that would involve aside, the question becomes… is it even possible to implement a new native UI component without sticking it into the internals of MrEd?
>Currently, all of the plumbing that handles the linkage of the GUI classes with their underlying native counterparts is tightly woven into the gui library itself. There’s no way for an external package to hook into that system and add something new, as far as I can tell. Ideally, I’d like to be able to write a native library for each platform to define a GTK widget, a Cocoa view, and a Windows… whatever they’re called in Windows. (I don’t do Windows development.) Then I’d be able to write my own plumbing to connect those native components with a Racket class that would provide the adequate abstractions.
>I’m willing to work out those problems, but in order to do that, I do need to figure out a suitable method for actually adding a GUI component. I’d love for adding a web view to be as easy as typing (new web-view% [parent frame] [url " http://google .com "]) and have it just work.
>Is this possible? Is it foreseeably possible? If not, what would be the best way to integrate such functionality so that it’s at least semi-composable with the existing libraries?
>(As a note, rendering to a canvas% or something like that is most certainly out of the question. Chromium needs access to the window itself to get the hardware-accelerated performance necessary to actually make it feasible.)
>  Racket Users list:
>   http://lists.racket-lang.org/users

Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141211/a193a525/attachment-0001.html>

Posted on the users mailing list.