Discussion:
Suckless Laser GUI
Charlie Paul
2013-07-01 21:30:12 UTC
Permalink
Hello,

I'm working for a lab, and I'm making a piece of software to control a
table full of optical elements (mirrors, lasers, and detectors). I wrote a
nice little interface to the hardware in C, but now I need to make a way
for the user to control the elements (move mirrors, turn stuff on and off,
change wavelength, and so on). It needs to be operated with mouse only (no
room for keyboard on table), and needs to be graphical (since it should
match up to the layout of the table).

Now, my issue is choosing a GUI library. GTK and QT are big, and I don't
want to have to install a dynamic language to do Tk. However, I do need to
be able to do custom drawing (for the table elements on-screen). What GUI
for C fits the bill?


Thanks,

Charles Paul
David
2013-07-01 21:34:57 UTC
Permalink
Hello,

Less of a GUI, more of a "do it yourself" toolkit. You could write your
own little GUI toolkit using OpenGL and use glfw,
http://www.glfw.org/
https://github.com/glfw/glfw
to provide a OpenGL context. I don't recommend this though if you need
advanced controls and especially lots of different controls, writing a
complete GUI is not an easy job, but if you only need limited controls
with limited options, this might work for you.
Also note, OpenGL can be a bitch, if you need your work done fast, this
probably also not an option, OpenGL takes time to learn especially OpenGL 3.

Best regards,
David
Calvin Morrison
2013-07-01 21:48:31 UTC
Permalink
I'd use GTK, since writing programs for it isn't terrible, it's in C
and you can just draw to a pixel buffer.

It sucks, but isn't not so sucky
Post by Charlie Paul
Hello,
Less of a GUI, more of a "do it yourself" toolkit. You could write your own
little GUI toolkit using OpenGL and use glfw,
http://www.glfw.org/
https://github.com/glfw/glfw
to provide a OpenGL context. I don't recommend this though if you need
advanced controls and especially lots of different controls, writing a
complete GUI is not an easy job, but if you only need limited controls with
limited options, this might work for you.
Also note, OpenGL can be a bitch, if you need your work done fast, this
probably also not an option, OpenGL takes time to learn especially OpenGL 3.
Best regards,
David
Carlos Torres
2013-07-01 22:12:08 UTC
Permalink
Post by Charlie Paul
Hello,
I'm working for a lab, and I'm making a piece of software to control a
table full of optical elements (mirrors, lasers, and detectors). I wrote a
nice little interface to the hardware in C, but now I need to make a way
for the user to control the elements (move mirrors, turn stuff on and off,
change wavelength, and so on). It needs to be operated with mouse only (no
room for keyboard on table), and needs to be graphical (since it should
match up to the layout of the table).
Post by Charlie Paul
Now, my issue is choosing a GUI library. GTK and QT are big, and I don't
want to have to install a dynamic language to do Tk. However, I do need to
be able to do custom drawing (for the table elements on-screen). What GUI
for C fits the bill?
You could/should try swk
Post by Charlie Paul
Thanks,
Charles Paul
Noah Birnel
2013-07-02 02:57:09 UTC
Permalink
Post by Carlos Torres
You could/should try swk
Got a link?
Charlie Paul
2013-07-02 03:00:06 UTC
Permalink
Post by Noah Birnel
Got a link?
Here is its announcement: http://lists.suckless.org/dev/1005/3997.html
and the git repo: http://git.suckless.org/swk
Kai Hendry
2013-07-02 02:07:25 UTC
Permalink
Write your UI as a Web application.
Charlie Paul
2013-07-02 02:11:12 UTC
Permalink
Post by Kai Hendry
Write your UI as a Web application.
That wouldn't work, as movement needs to be low latency.
Calvin Morrison
2013-07-02 02:22:52 UTC
Permalink
He's joking
Post by Charlie Paul
Post by Kai Hendry
Write your UI as a Web application.
That wouldn't work, as movement needs to be low latency.
Charlie Paul
2013-07-02 02:24:09 UTC
Permalink
Post by Calvin Morrison
He's joking
Considering that the originaly drivers for some of the optics were
written in Ruby, it is hard to be sure about that...
Chris Down
2013-07-02 02:36:21 UTC
Permalink
Post by Calvin Morrison
He's joking
You wouldn't be so sure if you knew the man. It's Kai we're talking
about here; the web shines out of his every orifice. :-D
Kai Hendry
2013-07-02 03:14:31 UTC
Permalink
Post by Chris Down
Post by Calvin Morrison
He's joking
You wouldn't be so sure if you knew the man. It's Kai we're talking
about here; the web shines out of his every orifice. :-D
That's right. I'm not joking. The Web sucks less than crappy qt/gtk apps.

On the topic of latency, might Web sockets help?
http://dev.w3.org/html5/websockets/
Noah Birnel
2013-07-02 06:10:18 UTC
Permalink
Post by Charlie Paul
Post by Kai Hendry
Write your UI as a Web application.
That wouldn't work, as movement needs to be low latency.
It needn't be a remote server, if the idea appeals otherwise.
Eon S. Jeon
2013-07-02 04:50:05 UTC
Permalink
Hello,
Post by Charlie Paul
Now, my issue is choosing a GUI library. GTK and QT are big, and I don't
want to have to install a dynamic language to do Tk. However, I do need to
be able to do custom drawing (for the table elements on-screen). What GUI
for C fits the bill?
I would recommend SDL. It's a thin cross-platform multimedia library,
which handles 2D/3D rendering and user input. However, it exposes many
low-level details, so it might be difficult to use it without enough
knowledge.

Sincerely
Eon
Dmitrij Czarkoff
2013-07-02 05:03:24 UTC
Permalink
Tk?

--
Dmitrij D. Czarkoff
Charlie Paul
2013-07-02 05:05:18 UTC
Permalink
Tk?
Tk doesn't play nicely with non-dynamic languages, if I recall correctly.
Edgaras
2013-07-02 05:08:12 UTC
Permalink
Post by Charlie Paul
Hello,
I'm working for a lab, and I'm making a piece of software to control a
table full of optical elements (mirrors, lasers, and detectors). I wrote a
nice little interface to the hardware in C, but now I need to make a way
for the user to control the elements (move mirrors, turn stuff on and off,
change wavelength, and so on). It needs to be operated with mouse only (no
room for keyboard on table), and needs to be graphical (since it should
match up to the layout of the table).
Now, my issue is choosing a GUI library. GTK and QT are big, and I don't
want to have to install a dynamic language to do Tk. However, I do need to
be able to do custom drawing (for the table elements on-screen). What GUI
for C fits the bill?
Thanks,
Charles Paul
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
David
2013-07-02 06:11:36 UTC
Permalink
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Chris Down
2013-07-02 06:12:26 UTC
Permalink
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
I also find Tk horrible, but I don't know any better GUI toolkit.
Edgaras
2013-07-02 07:46:24 UTC
Permalink
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
David
2013-07-02 10:33:08 UTC
Permalink
Post by Edgaras
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
It looks like crap on every platform, the api is painful (even though
defenitly not the worst I have ever seen).
I would probably go with Gtk if it has to be C (or my own, -> OpenGL).
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
Tk has none of the advantages each of the "3 Major" (gtk, wx, Qt),
additionally (as mentioned before), it looks like crap on every platform.

- David
Jens Staal
2013-07-02 10:33:27 UTC
Permalink
Post by David
Post by Edgaras
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
It looks like crap on every platform, the api is painful (even though
defenitly not the worst I have ever seen).
I would probably go with Gtk if it has to be C (or my own, -> OpenGL).
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
Tk has none of the advantages each of the "3 Major" (gtk, wx, Qt),
additionally (as mentioned before), it looks like crap on every platform.
- David
What about EFL? It is C, permissive and can be made to look pretty OK...

no experience making something with it however.
David
2013-07-02 10:39:29 UTC
Permalink
Post by Jens Staal
Post by David
Post by Edgaras
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
It looks like crap on every platform, the api is painful (even though
defenitly not the worst I have ever seen).
I would probably go with Gtk if it has to be C (or my own, -> OpenGL).
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
Tk has none of the advantages each of the "3 Major" (gtk, wx, Qt),
additionally (as mentioned before), it looks like crap on every platform.
- David
What about EFL? It is C, permissive and can be made to look pretty OK...
no experience making something with it however.
I have never heared of that one before. Might be an option, if you don't
need Windows support? Doesn't look native but not bad.
Thanks for pointing it out!
Edgaras
2013-07-02 10:48:41 UTC
Permalink
Post by David
Post by Edgaras
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
It looks like crap on every platform, the api is painful (even though
defenitly not the worst I have ever seen).
Afaik looks like crap is old argument, new themed tk widgets integrate into os
very well. And although I havent yet done large stuff with tk (though I'm
planing, thats why I'm interested), I have not seen anything particularly
painful. Most things seem quite intuitive and simple, and I also like tcl quite
a bit. Only annoying thing I found so far is that listbox widget is not storing
key - value pairs, only "keys", this is a bit nasty when working with data from
db.

Anyways I would be very interested in what you find painful in tk?
Post by David
I would probably go with Gtk if it has to be C (or my own, -> OpenGL).
I think gtk has more dependancies? As for gl, writing qui lib sounds quite
painful, and you need semi decent hw for gl which might hurt portability.
Post by David
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
I have quite a bit of antipathy for wx. And Qt is Humongous, and is C++,
and I have doubts that it provides anything more dynamic than tk.
Post by David
Tk has none of the advantages each of the "3 Major" (gtk, wx, Qt),
additionally (as mentioned before), it looks like crap on every platform.
- David
Again for looks like crap, I think you should investigate it.
http://www.tkdocs.com/tutorial/firstexample.html#design

Look at shots there, it integrates quite well, though on linux it does not seem
to be fully configured, or maybe they used some dodgy gtk theme.
David
2013-07-02 11:24:56 UTC
Permalink
Post by Edgaras
Post by David
Post by Edgaras
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
It looks like crap on every platform, the api is painful (even though
defenitly not the worst I have ever seen).
Afaik looks like crap is old argument, new themed tk widgets integrate into os
very well. And although I havent yet done large stuff with tk (though I'm
planing, thats why I'm interested), I have not seen anything particularly
painful. Most things seem quite intuitive and simple, and I also like tcl quite
a bit. Only annoying thing I found so far is that listbox widget is not storing
key - value pairs, only "keys", this is a bit nasty when working with data from
db.
Anyways I would be very interested in what you find painful in tk?
The widgets too limited and I don't like the API, using it feels like a
hack (maybe personal preference)
Post by Edgaras
Post by David
I would probably go with Gtk if it has to be C (or my own, -> OpenGL).
I think gtk has more dependancies? As for gl, writing qui lib sounds quite
painful, and you need semi decent hw for gl which might hurt portability.
Portability is not the problem, the problem is, it takes time and as I
mentioned if you need it fast or don't want to invest the time or you
need lots of widgets, that makes no sense. I though it might workout for
his "Laser-Project".
Post by Edgaras
Post by David
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
I have quite a bit of antipathy for wx. And Qt is Humongous, and is C++,
and I have doubts that it provides anything more dynamic than tk.
Qt, has a ton more widgets and is incredibly powerful in combination
with Qml (also QWebKit, but Gtk provides that, too).
Post by Edgaras
Post by David
Tk has none of the advantages each of the "3 Major" (gtk, wx, Qt),
additionally (as mentioned before), it looks like crap on every platform.
- David
Again for looks like crap, I think you should investigate it.
http://www.tkdocs.com/tutorial/firstexample.html#design
Look at shots there, it integrates quite well, though on linux it does not seem
to be fully configured, or maybe they used some dodgy gtk theme.
When I played around with tk, it looked like crap on Windows and my
Linux, maybe this changed?

- David
hiro
2013-07-02 14:34:34 UTC
Permalink
Post by David
Post by Edgaras
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
It looks like crap on every platform, the api is painful (even though
defenitly not the worst I have ever seen).
I would probably go with Gtk if it has to be C (or my own, -> OpenGL).
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
Tk has none of the advantages each of the "3 Major" (gtk, wx, Qt),
additionally (as mentioned before), it looks like crap on every platform.
- David
you're the most horrible person that has ever written to this mailinglist
David
2013-07-02 14:58:47 UTC
Permalink
Post by hiro
Post by David
Post by Edgaras
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
It looks like crap on every platform, the api is painful (even though
defenitly not the worst I have ever seen).
I would probably go with Gtk if it has to be C (or my own, -> OpenGL).
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
Tk has none of the advantages each of the "3 Major" (gtk, wx, Qt),
additionally (as mentioned before), it looks like crap on every platform.
- David
you're the most horrible person that has ever written to this mailinglist
<3
Nick
2013-07-02 15:20:24 UTC
Permalink
Post by David
Post by Edgaras
Post by David
Post by Edgaras
I think you should reconsider tk, though you need to install tcl and tk, tk is
quite nice to work with (with exception of some small hiccups), and if you have
a cli for controlling everything it should wrap around it quite well.
I personally find Tk horrible.
Horible in what way? Apart from web crap. what are alternatives to quickly
creating guis? Especially when you just need wrapper around some cli tool?
It looks like crap on every platform, the api is painful (even though
defenitly not the worst I have ever seen).
I would probably go with Gtk if it has to be C (or my own, -> OpenGL).
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
Tk has none of the advantages each of the "3 Major" (gtk, wx, Qt),
additionally (as mentioned before), it looks like crap on every platform.
I also disagree with your assesment of Tk, David. If you want
widgets that look native, the ttk stuff does that, and you can't
tell them apart from official 'native' GUI stuff. That said I've
never used ttk, because I like the simplicity of the old API, and tk
8.5 looks pretty to me, at least on Linux.

Tcl/Tk is a really nice, smooth environment for GUI programming -
it's designed by smart people who do things right, and as tcl and tk
are so intertwined everything fits together pretty naturally. I
suspect if you find the API painful you just need to spend a bit
more time playing with tcl.

If I was the OP I'd use a little Tcl/Tk program which calls the C
command stuff as appropriate, using pipes if it needs feedback.
That's what I do with my getxbook[0] GUI, and it works nicely.

I don't understand why there is a reluctance to the dynamic nature
of tcl/tk in the original requirements; I doubt tcl/tk would be much
slower than something like GTK or Qt, and given its simple and well
designed base it's an order of magnitude less buggy and smaller.

Otherwise, as someone else mentioned, EFL may fit, though I haven't
used it myself. swk also looks great, but it needs someone to use it
and contribute patches, as I understand.

0. http://njw.me.uk/getxbook/
Dmitrij Czarkoff
2013-07-02 18:10:03 UTC
Permalink
OFF TOPIC
Post by David
If you have e.g. python, I'd use wx and if I really need advanced
controls and a highly dynamic GUI, Qt.
I once wrote a rather small utility in python using Tkinter. My
co-workers wanted to use it, but they had Windows, and I wanted to
achieve better visual integration, so I replaced Tkinter with
wxpython. The resulting code was about 5-10% longer and felt like it
was several times slower - Tkinter version fired up instantly, while I
had to wait for a while to get wx version fully started. Eventually I
went with Tkinter, and with all quirks I added to make the app feel
more like typical Windows app it was still smaller and faster then
wxpython version.

--
Dmitrij D. Czarkoff

Noah Birnel
2013-07-02 06:09:03 UTC
Permalink
Post by Charlie Paul
I don't
want to have to install a dynamic language to do Tk.
Why? Can't control your deployment environment, don't have the resources,
doesn't feel pure to you? Something else?
Loading...