Designing a GUI.

801 views
Skip to first unread message

Zippoxer

unread,
Jul 8, 2011, 10:14:13 AM7/8/11
to golang-nuts
Is there any GUI designer that generates code that some library that
has a binding for Go can execute?
If it's not clear, I just want to use a GUI designer instead of
programming my GUI (GTK / FLTK / whatever).

Alexander Neumann

unread,
Jul 8, 2011, 11:22:16 AM7/8/11
to golang-nuts
If you are doing Windows stuff, you may want to try Walk. It comes
with the ui2walk tool, which generates Go code from Qt Designer .ui
files.

https://github.com/lxn/walk

- Alex

Zippoxer

unread,
Jul 8, 2011, 11:38:20 AM7/8/11
to golang-nuts
Nice. thanks.

abiosoft

unread,
Jul 8, 2011, 4:25:27 PM7/8/11
to golang-nuts

Zippoxer

unread,
Jul 9, 2011, 7:11:15 AM7/9/11
to golang-nuts
Does it have a designer?

On Jul 8, 11:25 pm, abiosoft <abiol...@gmail.com> wrote:
> go-gtkhttps://github.com/mattn/go-gtk

bflm

unread,
Jul 9, 2011, 7:23:35 AM7/9/11
to golan...@googlegroups.com
On Saturday, July 9, 2011 1:11:15 PM UTC+2, Zippoxer wrote:
Does it have a designer?

I think http://glade.gnome.org/ is worth taking a look. 

Zippoxer

unread,
Jul 9, 2011, 9:30:20 AM7/9/11
to golang-nuts
But it doesn't generate Go code :\

Honza

unread,
Jul 9, 2011, 9:35:11 AM7/9/11
to Zippoxer, golang-nuts

Then binding gtk-builder is one way and writing a glade-xml2go tool is another ;-)

Dne 9.7.2011 15:30 "Zippoxer" <zipp...@gmail.com> napsal/a:



But it doesn't generate Go code :\


On Jul 9, 2:23 pm, bflm <befelemepesev...@gmail.com> wrote:

> On Saturday, July 9, 2011 1:11:15 PM ...

Zippoxer

unread,
Jul 9, 2011, 9:50:55 AM7/9/11
to golang-nuts
So that's where C++ is easier than Go.
Thanks anyway, fortunately I was just interested, not going to design
any GUI.

On Jul 9, 4:35 pm, Honza <befelemepesev...@gmail.com> wrote:
> Then binding gtk-builder is one way and writing a glade-xml2go tool is
> another ;-)
>
> Dne 9.7.2011 15:30 "Zippoxer" <zippo...@gmail.com> napsal/a:

Zippoxer

unread,
Jul 9, 2011, 9:53:42 AM7/9/11
to golang-nuts
Take my first sentence of my last message and add " in the meantime"
before the dot.

On Jul 9, 4:35 pm, Honza <befelemepesev...@gmail.com> wrote:
> Then binding gtk-builder is one way and writing a glade-xml2go tool is
> another ;-)
>
> Dne 9.7.2011 15:30 "Zippoxer" <zippo...@gmail.com> napsal/a:

DisposaBoy

unread,
Jul 9, 2011, 10:23:30 AM7/9/11
to golan...@googlegroups.com
Why is it so important for it to be able to generate code?
Just curious...

Zippoxer

unread,
Jul 9, 2011, 3:07:04 PM7/9/11
to golang-nuts
Because I don't want to design my GUI by writing a Go code, but to
visually design it (much faster and easier).

Honza

unread,
Jul 9, 2011, 3:13:51 PM7/9/11
to golang-nuts

That's independent from the method which creates the GUI at runtime. Generating Go code for that task is only one of them. Loading the .glade definition of the visually designed GUI by a C or Go lib is another.

Dne 9.7.2011 21:07 "Zippoxer" <zipp...@gmail.com> napsal/a:



Because I don't want to design my GUI by writing a Go code, but to
visually design it (much faster and easier).


On Jul 9, 5:23 pm, DisposaBoy <disposa...@konnichi.com> wrote:

> Why is it so important for it to b...

DisposaBoy

unread,
Jul 9, 2011, 6:11:02 PM7/9/11
to golan...@googlegroups.com
But you wouldn't need to. You design your ui using glade in the case of gtk which gives you a ui(ui builder, the old glade format is long dead) file e.g my.ui.
You then load this at runtime, it even does automatic event binding etc so you most likely don't even need to write code to connection events to your buttons etc.
If you state some reasons for requiring the code generated maybe we can make some alternative suggestions because in practice, generated code has no benefit over separating the two concerns - I'd go as far as saying it has non whatsoever.

Lockal

unread,
Jul 10, 2011, 4:28:17 AM7/10/11
to golang-nuts
> So that's where C++ is easier than Go.

Go can be used for GUI programming. At least we should not reinvent
meta-system (signals/slots in qt or delegates in C#), because we
already have channel mechanism.
Someone still have to implement this approach in Go before we can use
it.

Alexander Neumann

unread,
Jul 10, 2011, 6:57:26 AM7/10/11
to golang-nuts
Sure, if you don't consider type safety a benefit.

DisposaBoy

unread,
Jul 10, 2011, 7:31:00 AM7/10/11
to golan...@googlegroups.com
Type safety of what? Sorry I guess I just don't get it.

Alexander Neumann

unread,
Jul 10, 2011, 8:04:12 AM7/10/11
to golang-nuts
With generated code, you obviously access all widgets in your ui in a
type safe way. If you load your ui description at runtime, you throw
type safety out the window. You will have to do lookup by name / id
and perform a type assertion to access any widget in your dynamically
loaded ui.
Reply all
Reply to author
Forward
0 new messages