GNOME Bugzilla – Bug 669989
gtk_grid_attach(): Documentation doesn't mention multiple attachments to the same location
Last modified: 2012-04-28 06:19:50 UTC
It's not clear what happens if one attaches a widget to a Gtk::Grid at a location, which is already occupied by another widget. It's possible to guess that the widget already in the grid will be replaced if it's location and size is the same as of the new widget. However, what if both widgets overlap only partially? E.g. |---|---| | A | A | |---|---|---| | A | AB| B | |---|---|---| | B | B | |---|---| Mark
This should be dealt with first in the GTK+ API documentation, I guess.
Also, the documentation doesn't say anything about how the size of the GtkGrid and spacing within it is managed. For example, let's say I insert two widgets, that span more than one cell, into the grid as follows: 012345678 0 1 AA 2 AA BBB 3 AA BBB 4 BBB What's the distance between the left side of B and the right side of A? Is it 1*column_spacing, or 4*column_spacing? What is the distance between the left side of A and the left side of the GtkGrid? Is it 0 or 1*column_spacing?
It seemed pretty obvious to me that you should not do that. Furthermore, it not being mentioned in the docs should be a pretty strong hint that the outcome won't be what you hope for or can rely on.
Maybe we can add a note explicitly saying something like: "If one or more of the cells that _child_ would occupy is already occupied by another widget, the behaviour is undefined"? What about the comment 2? Should I file a separate bug for a description of spacing. I felt that the subject is similar and there might be no need for another bug.
> it not being mentioned in the docs should be a pretty strong hint > that the outcome won't be what you hope for or can rely on. I don't think that's how people think. People tend to guess what will happen and assume that that's the obvious thing, and that it's just that it's another thing that is not documented. Whatever actually happens should be documented. I guess a second addition at the same position is just ignored, but I haven't tried this. I guess there are other container widgets that could use the same hint.