Re: [gtk-list] Re: what's the opposite of the destroy signal?




Havoc Pennington wrote:

> For the benefit of the original poster - the alternative to _new() is
> that everything is supposed to happen in _init(), and then if you need
> more information to set up the widget (stuff that traditionally would
> be arguments to _new()), they should be settable via object arguments.
>
> So then you can create widgets with gtk_widget_new(), similar to the
> way you create canvas items.


  What is an example of an _init callback?

  This is how I'm trying to get it to work:

  widget is created
  data is created and added to widget with gtk_widget_set_data.
.  .  .

  on configure_event, data is accessed again and again
.  .  .

  on widget-destroy,
  data is freed
  widget is destroyed.

    I'm trying to use a callback on 'realize', but even realize happens
*after* configure_event.
configure_event tries to access nonexistant data and then crashes.

  The exact moment of widget creation should not be edited because it's inside
a Glade 'interface.c' file.
  Is breaking Glade-compatibility the only option?

  John




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