Computer Science Canada

GTK 3, Broadway and an HTML5 websocket gui, for free

Author:  btiffin [ Sat Apr 12, 2014 12:16 am ]
Post subject:  GTK 3, Broadway and an HTML5 websocket gui, for free

Just spreading word. This system needs testing and keeners and fans.

If you compile a GUI with pkg-config --libs gtk+-3.0 then surprise surprise, GDK Broadway and the web. For free. An environment variable (and a broadwayd server if your greedy to run multiple GTK applications in a single browser - plus it eases up on X11 host rule setup while testing, so two environment variables and a tiny pass thru server).



will start up a normal desktop GUI as expected, and been there, done that.



broadwayd :1
Listening on /run/user/1000/broadway1.socket

in a server terminal session, then

Nothing, until a browser goes to

Posted Image, might have been reduced in size. Click Image to view fullscreen.

The GTK+ 3 application is in the browser. Listening on a websocket, GDK broadway can serve standalone on DISPLAY=:0, but in this case there is the broadwayd multicaster in the middle, servicing DISPLAY :1, port 8080, :2 would be 8081, etc.

Back at the launcher window...

BROADWAY_DISPLAY=:1 GDK_BACKEND=broadway ./gtk-demo
In the year 2014 somebody clicked 2014/03/31
In the year 2014 somebody clicked 2014/04/01
In the year 2014 somebody clicked 2014/04/08

Anyway, the cool stuff. GTK gui in a browser, clicks and events over HTML5 and websockets. And the terminal session that launched the application? Gets all its standard output, as expected, logging etc or for recursive shenanigans, running some CGI or a little webserver of its own)

Put GTK applications on the web, for free, no changes to code, just link to gtk+=3.0 and a GDK_BACKEND environment variable, all thanks to smart other people.

As stated, the project could likely use some testers, and contributors, and interested parties. Huge potential, in my old guy opinion.