After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 657793 - Support NULL sibling in gtk_grid_attach_next_to
Support NULL sibling in gtk_grid_attach_next_to
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-08-31 10:02 UTC by Alexander Larsson
Modified: 2011-09-03 00:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkGrid: make attaching more flexible (17.12 KB, patch)
2011-09-03 00:07 UTC, Matthias Clasen
committed Details | Review

Description Alexander Larsson 2011-08-31 10:02:47 UTC
It would be nice if I could pass NULL for sibling in gtk_grid_attach_next_to, meaning attach at the beginning or end of the current contents. This isn't perfectly defined. As if you specify e.g. BOTTOM you don't know which column is meant. However, if we just assume the first column you would be fine.

Having this means you can e.g. do:

GtkWidget *last = NULL;

for (i = 0; i < LEN; i++) {
   child = ...
   gtk_grid_attach_next_to (grid, child, last, GTK_POS_BOTTOM,
                            CHILD_WIDTH, CHILD_HEIGHT);
   ...
   last = child;
}

You can do a similar loop just with gtk_container_add, but then you can't specify
the span of the child.
Comment 1 Matthias Clasen 2011-09-03 00:07:43 UTC
The following fix has been pushed:
ef4690d GtkGrid: make attaching more flexible
Comment 2 Matthias Clasen 2011-09-03 00:07:46 UTC
Created attachment 195547 [details] [review]
GtkGrid: make attaching more flexible

Allow to attach children at either end of row/column 0.
Proposed by Alex Larsson.