# (debian,eclipse) modify the code of a window created with glade

**URL:** <https://www.ruby-forum.com/t/debian-eclipse-modify-the-code-of-a-window-created-with-glade/166458>\
**Category:** Ruby\
**Created:** [April 25, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/debian-eclipse-modify-the-code-of-a-window-created-with-glade/166458 "2009-04-25T16:02:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jolivierld](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jolivierld](https://www.ruby-forum.com/u/jolivierld)\
**Post date:** [April 25, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/debian-eclipse-modify-the-code-of-a-window-created-with-glade/166458/1 "2009-04-25T16:02:13Z")

</div>

hello,

I would like to create a window with glade, import it in a ruby project,  
and add a buton to it but from eclipse.

here it is an example:

* * *

#!/usr/bin/env ruby

# 

require ‘libglade2’  
require ‘gtk2’  
class MonAppli  
attr\_accessor:main\_glade\_xml  
def initialize(file, root)  
@main\_glade\_xml = GladeXML.new(file, root) {|handler|  
method(handler)}  
#@main\_glade\_xml[‘fenetre\_2’].show\_all  
end  
def on\_button1\_clicked  
puts “clicked !”  
end  
end

Gtk.init  
a=MonAppli.new(“/home/lolveley/eclipse/plan\_de\_travail/test\_1/fenetre\_2.glade”,nil)

a.main\_glade\_xml[“window1”].add\_child(new Button(“bouton 1”))

# marche

a.main\_glade\_xml[“window1”].show\_all  
Gtk.main

* * *

but I can’t find the correct term to use for “button” : I tried  
Gtk::button but I have this error then : “undefined method `Button’ for  
Gtk:Module”.

can you help me?

olivier.

* * *

Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son  
interface révolutionnaire.

> **[Yahoo](https://mail.yahoo.com/)**
>
> It's
