Re: Thoughts on GTK+ and CSS



Am Fri, 31 Jul 2009 10:33:41 +0200
schrieb Robert Staudinger <robert staudinger gmail com>:

> On Thu, Jul 30, 2009 at 4:37 PM, Christian
> Dywan<christian lanedo com> wrote:
> 
> [...]
> 
> > You are probably aware that gtk_container_get_children () does give
> > yo the positions of children. Assuming that the lack of guarantees
> > about order of widgets in a container is the actual problem, maybe
> > this can be reconsidered. There was a bug I can't find right now
> > suggesting a policy for this containers would be recommended to
> > follow.
> 
> We probably mean the same. GtkTable for example simply
> g_list_prepend()s in gtk_table_attach() -- thus I would just not use
> the word "position" here.
> 
> That said, does it sound entirely off to gtk veterans trying to
> implement widget position as a read-only container child property?
> 
> Sticking to the table example above -- a table child's position could
> easily be calculated using row (-count) and column (-count). From a
> quick look over the code this might not be quite as easy for box
> widgets, but maybe the child position could be calculated in the
> allocate() run and cached inside GtkBoxChild.

I wonder what the API might look like.

gtk_container_get_child_position (GtkContainer* container,
                                  GtkWidget*    child,
                                  gint*         row,
                                  gint*         column);
gtk_container_get_child_at (container, child, row, column);

Can we assume that any container either lines up its children in one
row or in 2 dimensions?
Do we need or want to take into account the concept of primary and
secondary children in boxes in the context?

ciao,
    Christian


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