Re: [gtk-list] Re: ANNOUNCE: GTK+ 1.1.5 Released



Tim Janik <timj@gtk.org> writes:

> it will integrate very well, trust me ;)

I don't think so, not in its current form anyway. The problem is that
we can't call gtk_type_new() directly in Gtk--, because we provide or
own types (this to override the widget's signals).

So, initially, when you had

gtk_foowidget_new()
{
  widget = gtk_type_new();
  /*
   * more widget setup code, like setting adjustments etc...
   */
}

in Gtk-- we had to do

Gtk_FooWidget::Gtk_FooWidget()
{
  /*
   * duplicate widget setup code
   */
}

The solution was then to have the widget setup code isolated in a
seperate, standardly named, function (hence its '_construct()' suffix)
which we could call from our constructor.

So with the new gtk+ construction mechanism, off the top of my head
I'd say that we'll just need a gtk_widget_construct() to allow us to
shunt the call to gtk_type_new().

Then again, this is just a quick answer without really looking at the
new code (I'll do this tonight). There may be other, more elegant
solutions, or may be the amount of code duplication will be small
enough to be manageable in the long run (if it's just a couple of
set_adjustment() here and there, well, we can live with that).

-- 
					Guillaume.
					http://www.worldnet.fr/~glaurent



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