# GUI toolkit proposal

**URL:** <https://rubytalk.org/t/gui-toolkit-proposal/74092>\
**Category:** ruby-talk\
**Created:** [12 March 2017 14:31 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092 "2017-03-12T14:31:53Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![A\_D\_Masiakos](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a_d_masiakos/32/1874_2.png) [@A\_D\_Masiakos](https://rubytalk.org/u/A_D_Masiakos)\
**Post date:** [12 March 2017 14:31 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/1 "2017-03-12T14:31:53Z")

</div>

A big hello to the ruby community!

I really need your help and proposals regarding a GUI toolkit, i want to  
build a desktop application that must be shipped in Linux and Windows  
platforms, i have the following toolkits in my mind but i cannot decide  
on what to use:

1) Tk bindings, i have see that it might be a little difficult to find  
proper documentation.

2) GTK2 bindings,

3) Fox GUI,

4) Visual ruby ( GTK2 bindings also? correct me if I'm wrong ).

5) Shoes toolkit,

what is considered to be the "standard" to use in the ruby world? I have  
some experience with the Fox toolkit, but i really don't know.

What will you use on a newly designed application?

> **···**
>
> --  
> --  
> --A.D Masiakos  
> --KeyId: 0x48D84811  
> ---[http://recodestuff.wordpress.com](http://recodestuff.wordpress.com)

---

<div class="post-metadata">

**Author:** ![Marvin\_Gulker](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Marvin\_Gulker](https://rubytalk.org/u/Marvin_Gulker)\
**Post date:** [12 March 2017 17:50 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/2 "2017-03-12T17:50:01Z")

</div>

> 1) Tk bindings, i have see that it might be a little difficult to find  
> proper documentation.

Beware Tk is not in the stdlib anymore for new versions of Ruby,  
otherwise this is a fine choice if you know how to resolve the "looks  
lik Win95" problem on Windows 8 and earlier (it is possible, just don't  
ask me how). Win10 should be fine as it turns on visual styles always.

> 2) GTK2 bindings,

These are well-maintained, and well-documented, and  
cross-platform. Probably your best choice. On Windows, you need to ship  
it as a DLL, though, as it's not native.

> 3) Fox GUI,

Not developed anymore since years, do not use.

> 4) Visual ruby ( GTK2 bindings also? correct me if I'm wrong ).

Windows-only, does not fit your requirements.

> 5) Shoes toolkit,

Not canonical Ruby, but some extra tools on top of Ruby. I cannot really  
comment on that.

If you feel like contributing to a Ruby project, try Hanmac's rwx, which  
is an unfinished binding to wxWidgets: [GitHub - Hanmac/rwx: wxWidgets binding for ruby](https://github.com/hanmac/rwx)

> what is considered to be the "standard" to use in the ruby world? I have  
> some experience with the Fox toolkit, but i really don't know.

Ruby and GUI, especially on Windows, is a big problem as basically  
nobody uses that combination. Ruby is mostly used on Unix server  
systems, so there is no "standard" for GUI development at all.

> What will you use on a newly designed application?

C++ with GTK, wxWidgets or Qt. Ruby is a nice language, but alone the  
problem that there is no Ruby installation easily available on Windows  
is going to cause problems, even if there is Ocra. I always use a  
compiled language if I need to target Windows. If you really want to do  
it in Ruby, I suggest to use GTK (i.e. the ruby-gnome project via the  
gtk\* gem family): [http://ruby-gnome2.osdn.jp/](http://ruby-gnome2.osdn.jp/)

Greetings  
Marvin

> **···**
>
> --  
> Blog: [https://www.guelkerdev.de](https://www.guelkerdev.de)  
> PGP/GPG ID: F1D8799FBCC8BC4F

---

<div class="post-metadata">

**Author:** ![stomar](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@stomar](https://rubytalk.org/u/stomar)\
**Post date:** [12 March 2017 21:15 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/3 "2017-03-12T21:15:45Z")

</div>

6) Qt bindings

I used the `qtbindings` gem several years ago.  
Does anyone know the status of this project,  
or alternative bindings for Qt?

Regards,  
Marcus

> **···**
>
> Am 12.03.2017 um 15:31 schrieb A. D Masiakos:
> 
> > 1) Tk bindings, i have see that it might be a little difficult to find  
> > proper documentation.
> > 
> > 2) GTK2 bindings,
> > 
> > 3) Fox GUI,
> > 
> > 4) Visual ruby ( GTK2 bindings also? correct me if I'm wrong ).
> > 
> > 5) Shoes toolkit,
> 
> --  
> GitHub: [stomar (Marcus Stollsteimer) · GitHub](https://github.com/stomar/)  
> PGP: 0x6B3A101A

---

<div class="post-metadata">

**Author:** ![Hidetoshi\_NAGAI](https://avatars.discourse-cdn.com/v4/letter/h/49beb7/32.png) [@Hidetoshi\_NAGAI](https://rubytalk.org/u/Hidetoshi_NAGAI)\
**Post date:** [13 March 2017 15:13 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/4 "2017-03-13T15:13:08Z")

</div>

> 1) Tk bindings, i have see that it might be a little difficult to find  
> proper documentation.

On some (many?) of GUI toolkits, GUI operations are available  
on a specific thread.  
But, Ruby/Tk supports multi-thread GUI programming.  
Therefore, the following script (multiple threads control GUI) will work.

> **···**
>
> ------------------------------------------------------------------------------  
> require 'tk'
> 
> mainloop = Thread.new{Tk.mainloop; exit 0}
> 
> label1 = Tk::Label.new(:text=\>'LABEL-1', :fg=\>'black').pack  
> label2 = Tk::Label.new(:text=\>'LABEL-2', :fg=\>'black').pack
> 
> th1 = Thread.new{loop{sleep 1; label1.fg 'green'; sleep 1; label1.fg 'black'}}  
> th2 = Thread.new{loop{sleep 1.5; label2.fg 'red'; sleep 1.5; label2.fg 'black'}}
> 
> v = TkVariable.new(0)  
> label3 = Tk::Label.new(:textvariable=\>v).pack
> 
> Tk::Button.new(:text=\>'RESET', :command=\>proc{v.value = 0}).pack
> 
> begin  
> &nbsp;&nbsp;loop{ sleep 0.1; v.numeric += 1 }  
> ensure  
> &nbsp;&nbsp;puts "finish"  
> end  
> ------------------------------------------------------------------------------
> 
> In some cases (e.g. needs asynchronous operations),  
> this feature will make a GUI script simple.  
> --  
> Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)  
> Department of Artificial Intelligence, Kyushu Institute of Technology

---

<div class="post-metadata">

**Author:** ![Varro](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@Varro](https://rubytalk.org/u/Varro)\
**Post date:** [12 March 2017 19:16 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/5 "2017-03-12T19:16:01Z")

</div>

> > 1) Tk bindings, i have see that it might be a little difficult to find  
> > proper documentation.
> 
> Beware Tk is not in the stdlib anymore for new versions of Ruby,  
> otherwise this is a fine choice if you know how to resolve the "looks  
> lik Win95" problem on Windows 8 and earlier (it is possible, just don't  
> ask me how). Win10 should be fine as it turns on visual styles always.
> 
> > 2) GTK2 bindings,
> 
> These are well-maintained, and well-documented, and  
> cross-platform. Probably your best choice. On Windows, you need to ship  
> it as a DLL, though, as it's not native.
> 
> > 3) Fox GUI,

What? Says who? It still is getting regular updates on the 1.7  
branch.

> Not developed anymore since years, do not use.
> 
> > 4) Visual ruby ( GTK2 bindings also? correct me if I'm wrong ).
> 
> Windows-only, does not fit your requirements.
> 
> > 5) Shoes toolkit,
> 
> Not canonical Ruby, but some extra tools on top of Ruby. I cannot really  
> comment on that.
> 
> If you feel like contributing to a Ruby project, try Hanmac's rwx, which  
> is an unfinished binding to wxWidgets: [GitHub - Hanmac/rwx: wxWidgets binding for ruby](https://github.com/hanmac/rwx)
> 
> > what is considered to be the "standard" to use in the ruby world? I have  
> > some experience with the Fox toolkit, but i really don't know.
> 
> Ruby and GUI, especially on Windows, is a big problem as basically  
> nobody uses that combination. Ruby is mostly used on Unix server  
> systems, so there is no "standard" for GUI development at all.
> 
> > What will you use on a newly designed application?
> 
> C++ with GTK, wxWidgets or Qt. Ruby is a nice language, but alone the  
> problem that there is no Ruby installation easily available on Windows  
> is going to cause problems, even if there is Ocra. I always use a  
> compiled language if I need to target Windows. If you really want to do  
> it in Ruby, I suggest to use GTK (i.e. the ruby-gnome project via the  
> gtk\* gem family): [http://ruby-gnome2.osdn.jp/](http://ruby-gnome2.osdn.jp/)

I found it a \*lot\* less friendly than either FOX or Qt.

> **···**
>
> On Sunday, 12 Mar 2017 1:50 PM -0400, Marvin Gülker wrote:
> 
> --  
> Will

---

<div class="post-metadata">

**Author:** ![A\_D\_Masiakos](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/a_d_masiakos/32/1874_2.png) [@A\_D\_Masiakos](https://rubytalk.org/u/A_D_Masiakos)\
**Post date:** [12 March 2017 18:57 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/6 "2017-03-12T18:57:01Z")

</div>

Marvin thanks a lot for your thorough answer,

> > 1) Tk bindings, i have see that it might be a little difficult to find  
> > proper documentation.
> 
> Beware Tk is not in the stdlib anymore for new versions of Ruby,  
> otherwise this is a fine choice if you know how to resolve the "looks  
> lik Win95" problem on Windows 8 and earlier (it is possible, just don't  
> ask me how). Win10 should be fine as it turns on visual styles always.

i don't really have a problem with the ''looks like win95'' problem,  
it's going to be a GUI for a development tool (i already have most of  
its backend ready ) and i just want a way to control it except the cli.

> > 2) GTK2 bindings,
> 
> These are well-maintained, and well-documented, and  
> cross-platform. Probably your best choice. On Windows, you need to ship  
> it as a DLL, though, as it's not native.

will definitely look a little deeper on this one...

> > 3) Fox GUI,
> 
> Not developed anymore since years, do not use.

damn, really? and i thought it was still receiving some attention here:

> **[GitHub - larskanis/fxruby: FXRuby is an extension module for Ruby that...](https://github.com/larskanis/fxruby)**
>
> FXRuby is an extension module for Ruby that provides an interface to the FOX GUI toolkit. - GitHub - larskanis/fxruby: FXRuby is an extension module for Ruby that provides an interface to the FOX G...

> > 4) Visual ruby ( GTK2 bindings also? correct me if I'm wrong ).
> 
> Windows-only, does not fit your requirements.

ok, this is out of the question then...

> > 5) Shoes toolkit,
> 
> Not canonical Ruby, but some extra tools on top of Ruby. I cannot really  
> comment on that.

...

> If you feel like contributing to a Ruby project, try Hanmac's rwx, which  
> is an unfinished binding to wxWidgets: [GitHub - Hanmac/rwx: wxWidgets binding for ruby](https://github.com/hanmac/rwx)

will take a look on this too,

> > what is considered to be the "standard" to use in the ruby world? I have  
> > some experience with the Fox toolkit, but i really don't know.
> 
> Ruby and GUI, especially on Windows, is a big problem as basically  
> nobody uses that combination. Ruby is mostly used on Unix server  
> systems, so there is no "standard" for GUI development at all.
> 
> > What will you use on a newly designed application?
> 
> C++ with GTK, wxWidgets or Qt. Ruby is a nice language, but alone the  
> problem that there is no Ruby installation easily available on Windows  
> is going to cause problems, even if there is Ocra. I always use a  
> compiled language if I need to target Windows. If you really want to do  
> it in Ruby, I suggest to use GTK (i.e. the ruby-gnome project via the  
> gtk\* gem family): [http://ruby-gnome2.osdn.jp/](http://ruby-gnome2.osdn.jp/)

as i mentioned above, i already have most of the backend ready, so no  
time to re-write it ( as always ).  
Yes, Ocra does a very good job, once i had shipped an application  
written with fox, and it run and on linux through wine...probably i was  
lucky...!

> Greetings  
> Marvin

Thanks again Marvin!

> **···**
>
> On 03/12/2017 07:50 PM, Marvin Gülker wrote:
> 
> --  
> --  
> --A.D Masiakos  
> --KeyId: 0x48D84811  
> ---[http://recodestuff.wordpress.com](http://recodestuff.wordpress.com)

---

<div class="post-metadata">

**Author:** ![Patrick\_Bayford](https://avatars.discourse-cdn.com/v4/letter/p/d78d45/32.png) [@Patrick\_Bayford](https://rubytalk.org/u/Patrick_Bayford)\
**Post date:** [12 March 2017 22:54 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/7 "2017-03-12T22:54:05Z")

</div>

I agree with Martin on Tk, it is a fine set of tools BUT the documentation is poor, and it is most certainly NOT user friendly.

Shoes is a very nice set of GUI tools/routines, but, IMHO, is likely to be a little simplistic for full blown projects.

I have no experience of GTK, at least not as a programmer, although do know it is widely used for building "proper" applications, mainly within the Unix/Linux community. (see The Gimp for example)

Like Martin, I too would tend to use a true compiled language for Windows based applications, but am currently seeking an alternative to Borland's Delphi which does the job fine, BUT will not co-operate with Windows 10. Sadly, this seems to apply in part to both Ruby and Python!!!

> **···**
>
> On 12/03/2017 17:50, Marvin Gülker wrote:
> 
> > > 1) Tk bindings, i have see that it might be a little difficult to find  
> > > proper documentation.
> > 
> > Beware Tk is not in the stdlib anymore for new versions of Ruby,  
> > otherwise this is a fine choice if you know how to resolve the "looks  
> > lik Win95" problem on Windows 8 and earlier (it is possible, just don't  
> > ask me how). Win10 should be fine as it turns on visual styles always.
> > 
> > > 2) GTK2 bindings,
> > 
> > These are well-maintained, and well-documented, and  
> > cross-platform. Probably your best choice. On Windows, you need to ship  
> > it as a DLL, though, as it's not native.
> > 
> > > 3) Fox GUI,
> > 
> > Not developed anymore since years, do not use.
> > 
> > > 4) Visual ruby ( GTK2 bindings also? correct me if I'm wrong ).
> > 
> > Windows-only, does not fit your requirements.
> > 
> > > 5) Shoes toolkit,
> > 
> > Not canonical Ruby, but some extra tools on top of Ruby. I cannot really  
> > comment on that.
> > 
> > If you feel like contributing to a Ruby project, try Hanmac's rwx, which  
> > is an unfinished binding to wxWidgets: [GitHub - Hanmac/rwx: wxWidgets binding for ruby](https://github.com/hanmac/rwx)
> > 
> > > what is considered to be the "standard" to use in the ruby world? I have  
> > > some experience with the Fox toolkit, but i really don't know.
> > 
> > Ruby and GUI, especially on Windows, is a big problem as basically  
> > nobody uses that combination. Ruby is mostly used on Unix server  
> > systems, so there is no "standard" for GUI development at all.
> > 
> > > What will you use on a newly designed application?
> > 
> > C++ with GTK, wxWidgets or Qt. Ruby is a nice language, but alone the  
> > problem that there is no Ruby installation easily available on Windows  
> > is going to cause problems, even if there is Ocra. I always use a  
> > compiled language if I need to target Windows. If you really want to do  
> > it in Ruby, I suggest to use GTK (i.e. the ruby-gnome project via the  
> > gtk\* gem family): [http://ruby-gnome2.osdn.jp/](http://ruby-gnome2.osdn.jp/)
> > 
> > Greetings  
> > Marvin
> 
> --  
> Good luck in your quest,  
> Patrick Bayford

---

<div class="post-metadata">

**Author:** ![Marvin\_Gulker](https://avatars.discourse-cdn.com/v4/letter/m/aeb1de/32.png) [@Marvin\_Gulker](https://rubytalk.org/u/Marvin_Gulker)\
**Post date:** [13 March 2017 07:34 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/8 "2017-03-13T07:34:32Z")

</div>

It's been a while since I last did Ruby GUI development, basically back  
in the time when wxRuby was under active development. At that time,  
fxruby was definitely out of development. If it has gained momentum  
again, that's nice and good, but there definitely was a long hiatus when  
I was in need of a GUI toolkit for Ruby. I have not bothered to check it  
again after that, since I mentally labelled it as dead.

I then have made good experience with ruby-gnome2. It might not be the  
easiest toolkit to use, but it is definitely powerful, and if you come  
from C++ GUI design as I mostly do (with wxWidgets), then it isn't at  
all that overwhelming as the API is very similar.

By the way, as it was not mentioned yet: ruby-gnome2 also has gtk3  
bindings by now, though I haven't used them.

Greetings  
Marvin

> **···**
>
> On Sun, Mar 12, 2017 at 03:16:01PM -0400, Will Parsons wrote:
> 
> > \>\> [fxruby not developed anymore]
> > 
> > What? Says who? It still is getting regular updates on the 1.7  
> > branch.
> 
> --  
> Blog: [https://www.guelkerdev.de](https://www.guelkerdev.de)  
> PGP/GPG ID: F1D8799FBCC8BC4F

---

<div class="post-metadata">

**Author:** ![Stefano\_Crocco](https://avatars.discourse-cdn.com/v4/letter/s/5f9b8f/32.png) [@Stefano\_Crocco](https://rubytalk.org/u/Stefano_Crocco)\
**Post date:** [13 March 2017 12:33 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/9 "2017-03-13T12:33:11Z")

</div>

Unfortunately, the ruby Qt bindings aren't maintained anymore. The gem will  
still work, but only for Qt 4. Qt 4 is becoming obsolete, at least on Linux,  
so, until someone ports the bindings to Qt 5 I wouldn't advise using them for  
a new project.

Stefano

> **···**
>
> On Sunday, 12 March 2017 22:15:45 CET sto.mar@web.de wrote:
> 
> > Am 12.03.2017 um 15:31 schrieb A. D Masiakos:  
> > \> 1) Tk bindings, i have see that it might be a little difficult to find  
> > \> proper documentation.  
> > \>  
> > \> 2) GTK2 bindings,  
> > \>  
> > \> 3) Fox GUI,  
> > \>  
> > \> 4) Visual ruby ( GTK2 bindings also? correct me if I'm wrong ).  
> > \>  
> > \> 5) Shoes toolkit,
> > 
> > 6) Qt bindings
> > 
> > I used the `qtbindings` gem several years ago.  
> > Does anyone know the status of this project,  
> > or alternative bindings for Qt?
> > 
> > Regards,  
> > Marcus

---

<div class="post-metadata">

**Author:** ![botp1](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@botp1](https://rubytalk.org/u/botp1)\
**Post date:** [18 March 2017 07:41 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/10 "2017-03-18T07:41:25Z")

</div>

NaHi, do you have some recommended links for ruby tk programming. I  
unfortunately lost mine after my disk got toast : (

many thanks for rubytk  
--botp

> **···**
>
> On Mon, Mar 13, 2017 at 11:13 PM, Hidetoshi NAGAI \<nagai@ai.kyutech.ac.jp\> wrote:
> 
> > But, Ruby/Tk supports multi-thread GUI programming.

---

<div class="post-metadata">

**Author:** ![Daniel\_Ferreira1](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@Daniel\_Ferreira1](https://rubytalk.org/u/Daniel_Ferreira1)\
**Post date:** [13 March 2017 00:50 UTC](https://rubytalk.org/t/gui-toolkit-proposal/74092/11 "2017-03-13T00:50:08Z")

</div>

Hi,

Isn't jruby a way to go for this multi platform projects?

It is very said that ruby community can not give a solution for these kind  
of projects.

Even lua can use wxwidgets.

Hope one day we can get a group of people to work in resolving this issue.

But at least jruby is an entry door to many possibilities.

Regards,

Daniel
