[pygtk] Working with data between mainwindow and dialog

Timo List timomlists at gmail.com
Thu Nov 5 18:37:04 WST 2009


Let's start with my situation:

I have a mainwindow with a combobox and treeview. The treeview is filled
with data (people) according to the combobox item (group).

There is a dialog where I can add a group and also people for this group. On
another tab in this dialog, I can remove groups, selected from a combobox.


So if I add a group, I want the maincombobox and the deletion combobox to be
updated. The same when I remove a group, the maincombobox needs to be
updated.

What should I do?
I was thinking about passing the main class to the dialog, and when adding a
group, I can call a function in the main class to update the combobox.
This is what I usually do.

But now I was thinking about a custom signal. I have never done anything
with custom signals, so before I read in on this, I want to be sure this is
a right thing to do.
A sort of signal, that when it is called, the main and deletion combobox
will get updated with the passed data (new group).
If this is possible, how would this be done?

For what it's worth: I'm using Glade and gtkBuilder.

Timo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20091105/ab69d621/attachment.htm 


More information about the pygtk mailing list