Re: status bars and strangeness



В Птн, 08/07/2005 в 09:41 +0800, Davyd Madeley пишет:
> On Fri, 2005-07-08 at 05:20 +0400, Nickolay V. Shmyrev wrote:
> 
> > > Now, the appbar gets added as you might expect, however even though it
> > > is the only element in the status bar (as this is the only
> > > MGivaComponent window to have a status bar) the GnomeAppBar is not
> > > expanded to fill the width and the text portion of the appbar is about
> > > 2mm wide.
> > > 
> > > Thoughts? Am I doing something wrong, is this expected behaviour, or is
> > > this a bug somewhere in libbonoboui?
> > > 
> > 
> > I know it's badly documented, but isn't it what you are searching?
> > 
> > from docs/ui-xml.txt:
> > 
> > <control> - a control to be inserted into the status area. If
> > name="main" it overrides the standard bar. Otherwise it gets packed into
> > the right side of the status area.
> > 
> > If you don't want to be so small, but still want to have status text,
> > proper selection of size request on control side may have sense
> 
> I'm not quite sure what you're saying here. If I set the name to main,
> it simply becomes a GtkStatusBar and not the control I am trying to
> pack. Perhaps I've forgotten, but is there a way to set the size of a
> widget to be 'fill' and 'expand'? I seem to recall those properties are
> in the packing widgets.
> 
> --d
> 
The control node can have behavior attribute. In theory it can support
some packing option selection, but currently it handles only pack-start
substring.

Look at the following code in bonobo-ui-sync-statusbar.c:
---------------------------------------------------------------------------
        } else if (bonobo_ui_node_has_name (node, "control")) {
                char *behavior;
                char **behavior_array;

                widget = bonobo_ui_engine_build_control (sync->engine,
node);
                if (widget) {
                        behavior_array = NULL;
                        if ((behavior = bonobo_ui_engine_get_attr (node,
cmd_node, "behavior"))) {
                                behavior_array = g_strsplit
(behavior,",", -1);
                                bonobo_ui_node_free_string (behavior);
                        }

                        if (behavior_array != NULL &&
                            string_array_contains (behavior_array,"pack-
start"))
                                gtk_box_pack_start (GTK_BOX (parent),
widget,
                                                    FALSE, FALSE, 0);
                        else
                                gtk_box_pack_end (GTK_BOX
(parent),widget,
                                                  FALSE, FALSE, 0);

                        g_strfreev (behavior_array);
                }
        }

-----------------------------------------------------------------------------------
It would not be hard to implement other options to packing, but I am not
sure about perspectives of this work.





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