You need to have a reference to both objects in a class using GtkBuilder's get_object()
. Then, in the callback of the button just get both text with self.myfield1.get_text()
or so. Check this template on how to structure a PyGObject application:
How can a program that uses GUI be constructed?
Hope it helps.
EDIT: About the naming scheme, I would use whatever naming scheme is used on the language that would use the Glade file. When programming in PyGObject, I name the objects on the Glade file the same as Python variables so I can do this:
[...]
go = self.builder.get_object
self.window = go('window')
self.my_foobar = go('my_foobar')
[...]