[#1263] Draft of the updated Ruby FAQ — Dave Thomas <Dave@...>

33 messages 2000/02/08

[#1376] Re: Scripting versus programming — Andrew Hunt <andy@...>

Conrad writes:

13 messages 2000/02/15

[#1508] Ruby/GTK and the mainloop — Ian Main <imain@...>

17 messages 2000/02/19
[#1544] Re: Ruby/GTK and the mainloop — Yasushi Shoji <yashi@...> 2000/02/23

Hello Ian,

[#1550] Re: Ruby/GTK and the mainloop — Ian Main <imain@...> 2000/02/23

On Wed, Feb 23, 2000 at 02:56:10AM -0500, Yasushi Shoji wrote:

[#1516] Ruby: PLEASE use comp.lang.misc for all Ruby programming/technical questions/discussions!!!! — "Conrad Schneiker" <schneiker@...>

((FYI: This was sent to the Ruby mail list.))

10 messages 2000/02/19

[#1569] Re: Ruby: constructors, new and initialise — Yukihiro Matsumoto <matz@...>

The following message is a courtesy copy of an article

12 messages 2000/02/25

[ruby-talk:01600] Re: Ruby/GTK and the mainloop

From: Ian Main <imain@...>
Date: 2000-02-27 19:34:56 UTC
List: ruby-talk #1600
On Sat, Feb 26, 2000 at 03:51:32PM +0900, Masaki Fukushima wrote:
> Ian Main <imain@gtk.org> wrote:
> > GTK has good facilities for this.. from looking through ruby source code
> > again, it looks like ruby needs only:
> > 
> > * The ablity watch file descriptors for read/write readiness.
> > * A timeout for sleep() and similar functions.
> 
> Yes, and select system call exactly provides these facilities.

Yes, select() more less == mainloop in terminology.

> And these facilities are also enough for GTK, aren't they?
> So the simplest solution is the integration of select, IMHO.
> Fortunately, GTK provides g_main_set_poll_func() for this purpose.
> 
> The advantage of this approach is the simplicity.  Both GTK and
> Ruby can assume mainloop control.  GTK mainloop can be considered
> as a Ruby thread.  Ruby thread scheduler yields the control to
> GTK when GUI event occurs.
> 
> The problem with this approach:
> 
>  * Toolkit must provides select substitution API such as
>    g_main_set_poll_func().  I don't know that other toolkits than
>    GTK provide one.

and g_timeout_add for sleep () etc. right ?  This is what I was thinking.

>  * rb_thread_select() needs improvement to avoid busy wait with
>    more than one thread.  This involves eval.c hacking...
> 
> > Hopefully I am not missing any issues here.. if someone knows something I
> > don't please let me know! :)
> 
> My approach lacks the point of embedding Ruby as your Entity.
> Plese tell me if you find something wrong with this approach.

I think we are both thinking the same thing, so it should be fine.  I
beleive most other toolkits provide similar functions.

Entity uses GTK, so really, if you can get gtk and ruby working nicely, it
should embed nicely in Entity too.

Ian

In This Thread