top | item 4668487

Ask HN:To build a GUI should I take the HTML5/js path or stick to older techs?

3 points| zoobert | 13 years ago

I have built an application using Python and would like to add a graphical interface for that application. The application is multi-platform and I am looking for a solution that should run on Win/Mac/Linux.

I have checked the different widget toolkits in Python (PyQt/PySide and wxPython) but I am not satisfied by them because in general the learning curve is high and because by default, they produce "clunky" anonymous results.

So if I want to go further with them and produce a nice personalized result (create your own widgets, ...) , I need to be really invested and spend lots of time mastering them.

I am wondering if building a web based interface (HTML5/javascript) wouldn't be better ?

I could create the web interface and run it in chromium with an extension to manage all filesystems operation. I could also start a nodejs server and kill it when I stop the application.

Do you think it is a viable solution ?

Which road would you take (stick to widget toolkit, nodejs, chromium) ?

Any advices are welcome.

12 comments

order

dman|13 years ago

Check out enaml - https://github.com/enthought/enaml . It makes writing UI's in python really fun.

zoobert|13 years ago

Still it relies on wxPython or PyQT which is my problem because you are limited to the existing widgets somehow (or you need to create your own widgets and then it is slow and painful).

mouseroot|13 years ago

well for cross platform Qt or gtk,although everyone always says stay away from experimental I say use canvas If the user cant use the canvas fall back to jquery. I belive with the technologies we have now old idioms like "dont render gui on the canvas" this will soon fade away, running your own server for just that application may not work so well as you have to manage that server aswell, like what if the user isnt allowed to give the firewall access? or what if the server crashes and the client has import data that needs to saved? I personally have played with alot of gui stuff and I always come back to html5 and js so thats just my $0.02

zoobert|13 years ago

@mouseroot. Ok thanks for the advice. When I was talking about http server, I meant locally on the user's machine(start a nodejs for example and kill it when the user stop the application somehow).

Other solution is to use chromium with a filesystem extension.

Do you have tricks or advices for that ?

farseer|13 years ago

build the gui in html5, just use only the popular libraries such as jquery and stay away from the experimental stuff i.e. canvas or webgl.

zoobert|13 years ago

ok but after practically what do I do ?

I run it in a chromium, I launch a HTTP server ?

In the end I want to make a desktop GUI and I would like a solution which is not too clunky

camus|13 years ago

Depends on what you want to do. For gui development you should use a solution that has a GUI editor so you dont have to manually code your interface , i find it pretty important , that's why in my opinion Java with Swing is still the easiest way to go for multiplateform GUI development. Java is not that hard and tools like eclipse or netbeans provide gui editors. You want to use HTML5/Javascript ? then go with adobe air , you will be able to develop your app in full javascript/html and take advantage of the air API, and deploy in any plateform that can run air.