Re: Destroying widget in own callback



On Mon, 2007-06-11 at 10:40 +0200, Jeffrey Ratcliffe wrote:
The attached code produces the error message when the ComboBox is changed:

GLib-GObject-CRITICAL **: g_object_notify: assertion `G_IS_OBJECT
(object)' failed at ../assertiondemo.pl line 13.

which is not surprising, given that the ComboBox is being destroyed in
its own callback.

In my application, it would be rather cumbersome to have to avoid
destroying and recreating the widget in this way. Is there any other
way of getting rid of the error message?

yes: don't do that.

use a Gtk2::ListStore and feed it to the combo box; then clear the model
and repopulate it. a Gtk2::ComboBox works exactly like a
Gtk2::TreeViewColumn (both implement the CellView interface and are a
CellLayout).

ciao,
 Emmanuele.

-- 
Emmanuele Bassi,  E: ebassi gmail com
W: http://www.emmanuelebassi.net
B: http://log.emmanuelebassi.net




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]