glade2ruby 
Author Message
 glade2ruby

Hi,

I sit on a project where I have to write a GUI (gtk/gnome)
for a ruby core-model.
The features that should be accesible via the GUI depends on a lot of context
information - so the GUI-layout is very volatile.  Because of that, I
can't use glade/libglade to design/build the gui.

It would be perfect to design the gui in glade and generate code from the
glade-file to build the gui with that code.
Anybody knows something like glade2ruby??

Perhaps it is interesting for the glade-project too?

Sincerely,
Matthias

_________________________________________________________
Do You Yahoo!?



Tue, 09 Nov 2004 17:28:20 GMT  
 glade2ruby
hello

maybe this is what you are looking for:
http://www.ruby-lang.org/en/raa-list.rhtml?name=Ruby%2FLibGlade

I have never used it, that is, I can not say if it works

markus

Quote:

> Hi,

> I sit on a project where I have to write a GUI (gtk/gnome)
> for a ruby core-model.
> The features that should be accesible via the GUI depends on a lot of
> context
> information - so the GUI-layout is very volatile.  Because of that, I
> can't use glade/libglade to design/build the gui.

> It would be perfect to design the gui in glade and generate code from the
> glade-file to build the gui with that code.
> Anybody knows something like glade2ruby??

> Perhaps it is interesting for the glade-project too?

> Sincerely,
> Matthias

> _________________________________________________________
> Do You Yahoo!?




Tue, 09 Nov 2004 17:43:58 GMT  
 glade2ruby
On Fri, 24 May 2002 18:56:00 +0900

|MJ> hello
|MJ>
|MJ> maybe this is what you are looking for:
|MJ> http://www.ruby-lang.org/en/raa-list.rhtml?name=Ruby%2FLibGlade
|MJ>
|MJ> I have never used it, that is, I can not say if it works
|MJ>
|MJ> markus

hi,

this is exactly the wonderful package I can't use, because no code
is generated.. :(
Thanks nevertheless.

Best regards,
Matthias

_________________________________________________________
Do You Yahoo!?



Tue, 09 Nov 2004 23:58:21 GMT  
 glade2ruby

Quote:

>this is exactly the wonderful package I can't use, because no code
>is generated.. :(

I think that in the Ruby Developer book there is talk of something that
can turn the .glade xml file into a program.

Don't have my copy to hand, perhaps someone else has.



Wed, 10 Nov 2004 00:19:19 GMT  
 glade2ruby

Hello,

Is there a way to know about the binding of a Proc. I need something
like a_proc.binding().self():

class Scheduler
   def post( &block); enqueue( block); end
   def process_loop()
      while block = dequeue()
        res = block.call()
        block.binding.self.signal( res) # !!!
      end
   end
end

class User
   def action()
     myscheduler.post { puts "Help me" }
   end
   def signal( res ); puts "Thanks!"; end
end

I for sure can get by with a additional parameter:
   myscheduler.post self { puts "Help" }
.. but I would rather avoid it if possible.

RCR needed ?

Thanks,

Jean-Hugues

-------------------------------------------------------------------------
Web:  http://hdl.handle.net/1030.37/1.1
Phone: +33 (0) 4 92 27 74 17



Thu, 11 Nov 2004 23:03:05 GMT  
 glade2ruby
Hi,

At Mon, 27 May 2002 00:00:05 +0900,

Quote:

> Is there a way to know about the binding of a Proc. I need something
> like a_proc.binding().self():

> class Scheduler
>    def post( &block); enqueue( block); end
>    def process_loop()
>       while block = dequeue()
>         res = block.call()

          eval("self", block).signal(res)

Quote:
>       end
>    end
> end

--
Nobu Nakada


Thu, 11 Nov 2004 23:29:04 GMT  
 glade2ruby
Hello,


Quote:
>Hi,

>At Mon, 27 May 2002 00:00:05 +0900,

> > Is there a way to know about the binding of a Proc. I need something
> > like a_proc.binding().self():

> > class Scheduler
> >    def post( &block); enqueue( block); end
> >    def process_loop()
> >       while block = dequeue()
> >         res = block.call()
>           eval("self", block).signal(res)
> >       end
> >    end
> > end

>--
>Nobu Nakada

Hmm... I saw no mention about that in O'Reilly Ruby in a Nutshell.
According to it the second parameter of eval should be a binding...
Does it means that I can use a Proc where ever a Binding is needed ? That
would make sense I guess (Yet Proc#binding() would make sense too, from
a pure oo perspective).

Yours,

Jean-Hugues

-------------------------------------------------------------------------
Web:  http://hdl.handle.net/1030.37/1.1
Phone: +33 (0) 4 92 27 74 17



Fri, 12 Nov 2004 03:07:18 GMT  
 glade2ruby

J> According to it the second parameter of eval should be a binding...

pigeon% ruby -e 'eval "12", 12'
-e:1:in `eval': wrong argument type Fixnum (expected Proc/Binding) (TypeError)
        from -e:1
pigeon%

Guy Decoux



Fri, 12 Nov 2004 17:10:22 GMT  
 glade2ruby

Quote:

> On Fri, 24 May 2002 18:56:00 +0900

> |MJ> hello
> |MJ>
> |MJ> maybe this is what you are looking for:
> |MJ> http://www.ruby-lang.org/en/raa-list.rhtml?name=Ruby%2FLibGlade
> |MJ>
> |MJ> I have never used it, that is, I can not say if it works
> |MJ>
> |MJ> markus

> hi,

> this is exactly the wonderful package I can't use, because no code
> is generated.. :(
> Thanks nevertheless.

It's not clear from your original posting whether your interface will
be changing while the program is running, or whether the program will
use the same interface for each execution but you want to update that
interface often.

If the interface will be changing while the program is running, then
you'll have to write the GTK calls to do that yourself.

However, if the interface is static for the duration of the program,
then glade and libglade will do the job perfectly. Ruby-libglade (now
part of the ruby-gnome project on sourceforge) reads in a .glade file
and creates the GUI based on that, so you can easily change the
interface (ie the .glade file) and the ruby program will pick up the
changes.

All you have to do is write the functions that you want to call as
signal handlers.

I've used this approach to incrementally build a GUI for the lexis
exam system on http://www.doc.ic.ac.uk/lexis/

Cheers,
Mike
--

Computing Support Group, Imperial College Computing Department

"What's your username?"    *clickety* *click*



Fri, 12 Nov 2004 21:31:20 GMT  
 glade2ruby

Quote:

> Hi,

> I sit on a project where I have to write a GUI (gtk/gnome)
> for a ruby core-model.
> The features that should be accesible via the GUI depends on a lot of context
> information - so the GUI-layout is very volatile.  Because of that, I
> can't use glade/libglade to design/build the gui.

> It would be perfect to design the gui in glade and generate code from the
> glade-file to build the gui with that code.
> Anybody knows something like glade2ruby??

> Perhaps it is interesting for the glade-project too?

look at http://ruby-talk.com/38989
but i think this is not exactly what you want.
(i'm rewriting it to be more ruby-wayish though)

--

"Consider a spherical bear, in simple harmonic motion..."
                -- Professor in the UCB physics department



Mon, 15 Nov 2004 13:21:49 GMT  
 
 [ 12 post ] 

 Relevant Pages 
 

 
Powered by phpBB® Forum Software