Re: gtk_table and undefined behaviour?



On Sat, 13 Jul 2002 17:11:04 -0400 (EDT)
Owen Taylor <otaylor redhat com> wrote:


Marcus vA <mva121 gmx net> writes:

On Sat, 13 Jul 2002 11:02:35 -0400 (EDT)
Owen Taylor <otaylor redhat com> wrote:
[...]
(lingoteach:6221): Gtk-CRITICAL **: file gtktable.c: line 579
(gtk_table_attach): assertion `child->parent == NULL' failed

This means the widget already has been added to some container
(perhaps the table) already. 

Nice, but that does not solve the problem, does it?
If I only attach the labels to the widget, it works.
If I only attach the entry-boxes to the widget, it works.
If I try to attach both - undefined behaviour.

I do not know any solution for this or why this happens.

I haven't analyzed your code; just explaining what that error
message above means ... it means that you are trying to attach
one widget in two places.

I thought of that, but why? Maybe you can give me a quick example of
how to attach widgets to a gtk_table correctly (hopfully this will be the fault)?
If I have a table = gtk_table_new(4, 2, TRUE)

I could attach a label in the first cell (from left upper to right lower) with

gtk_table_attach_defaults(GTK_TABLE(table), label,
                                                   0, 1, 0, 1);

And a second one in the second cell (same row) with 

gtk_table_attach_defaults(GTK_TABLE(table), label_2,
                                                  1, 2, 0, 1);

Is that right? 
The sheme would look like the following:
      
        ------------------------------------- >>0 
        |               |               |               |
        |               |               |               | 
        ------------------------------------->>1
        |               |               |               |
        |               |               |               |
        ------------------------------------->>2
        ^             ^              ^              ^
        0             1              2              3

So the first (left upper) cell would be attachable by

0, 1, 0, 1

and the last one (right lower) by
2, 3, 1, 2

Hope, I got it right, because I'm working with this kind of 
sheme.

Regards
Marcus

Attachment: pgpdEjWOIUbsc.pgp
Description: PGP signature



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