Re: GtkPaned vs. GtkBox



From: Fritz Jetzek <fritz.jetzek@i-dmedia.com>
> hi,
> 
> i've been accustomed to use GtkPaneds instead of GtkBoxes wherever
> possible. there are two things which i'd like to remark: 

    I do not understand your design. The goal of GtkBox and GtkPaned
    are rather different : GtkBox is (well... :) a box - a container
    for multiple widgets.
    
    And to quote the tutorial:
    "The paned window widgets are useful when you want to divide 
    an area into two parts, with the relative size of the two 
    parts controlled by the user."

> 
> a) wouldn't it make sense to implement GtkPaneds in a way that makes it
> possible to add elements at will instead of just two? i'm working around
> this by nesting multiple paneds with each other but it seems suboptimal
> in a way. 

    Considering what I just told, it is not the goal of GtkPaned
    to hold more than 2 widgets. You'll have to play with boxes
    tables or fixed layout if you want to add more widgets around
    - then add your container to the paned window.
> 
> b) the settings of GtkBoxes are a bit more flexible in that they provide
> means to set filling and padding; i found no simple way to tell the
> elements contained in GtkPaneds to take up all the remaining space or
> otherwise behave like elements of a GtkBox
> 
> could someone comment on whether it would make sense to reimplement
> GtkPaned as being derived from GtkBox? 

    At this time, the design of the GK containers are rather simple:
    you have 
        * containers that caon contain multiple widgets (box and so on)
        * containers that can contain only one widget (window, button,
        paned window, ...)
    When you want to add more than one widget in the former you must
    first add a container that can handle all the widgets you want.
    This way you can do everything you want.

    I do not think this design will change and the GtkPaned will
    probably not be reimplemented this way.

    Hope it helps,

    Emmanuel

> 
> sorry for asking stupid questions, i just found it to be an obvious
> design flaw and couldn't resist posting ;)
> 
> fritz
> 
> 
> -- 
>          To unsubscribe: mail gtk-devel-list-request@redhat.com with 
>                        "unsubscribe" as the Subject.
> 
> 



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