Preserving functions after changing a glade project

Hello!

After saving my Glade file I use

“ruby-glade-create-template > myfile.rb”

to create a ruby file from it. Then I implement the functions,
so that buttons etc. have an effect. So far, so good.

But:

Whenever I change my Glade project, I’d also have to call
ruby-glade-create-template again, and all changes I made
to the ruby file are lost. :frowning:

What’s the best way to avoid that?

Thanks!
Wolfgang
(Sorry to all, I already know that this is a newbie question.
I’m new to Ruby and Gtk+/Gnome. :-}

Am Donnerstag, den 13.03.2008, 13:48 +0100 schrieb Wolfgang Kaiser:

Hello!

After saving my Glade file I use

“ruby-glade-create-template > myfile.rb”

to create a ruby file from it.

Hi,

don’t do this. It’s a maintenance night mare. With GladeXML.new you can
load your glade file and your window or dialogs will directly got build
from this. If you then cange your glade file it will get much easier to
update your code for this.

Cheers, detlef

Wolfgang Kaiser wrote:

“ruby-glade-create-template > myfile.rb”

Whenever I change my Glade project, I’d also have to call
ruby-glade-create-template again, and all changes I made
to the ruby file are lost. :frowning:

“It’s not a bug, it’s a feature.”

ruby-glade-create-template is just useful to create a fast application
based on that template to work on. You shouldn’t call it twice. The “>”
operator of your shell just overwrites the file if exists.

If you make changes in your glade file you can should adapt them
manually. Or you can call
ruby-glade-create-template myfile.glade

(without the “> myfile.rb”!) and look at the changes.