Re: subclassing GtkText

>>>>> "H" == Havoc Pennington <> writes:

 H> xander <> writes:
 >>  If I try to subclass GtkText I get coredumps.  Even if I replace
 >> the calls in example tictactoe correctly (gtk_text_get_type etc.)
 >> it still coredumps.

 H> Your program has a bug?

 H> Sorry, we can't guess what it is without some information. ;-)

I'm guessing here, so ignore me if I'm wrong.

xander, you're using the tktext port and you simply subclass it.  The
only initialisation happening then is the `init' function.  This will
not initialize the `text_buffer->tree', since the tree is initialised
in `new'.  Unfortunately, you cannot really use `new' to initialise
your subclass, and even worse, you cannot update the tree yourself
since the btree is not public.

I send a patch to gtk-devel a little back[1], that moved the
initialization to a `construct' method, but the patch has not been


[1] You can get the patch from the mailing list archive

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