Re: status bars and strangeness
"Nickolay V. Shmyrev" <[email protected]> Sat, 09 Jul 2005 14:22:29 +0400
| Newsgroups | gmane.comp.gnome.components |
|---|---|
| Message-ID | <[email protected]> |
=F7 =F0=D4=CE, 08/07/2005 =D7 09:41 +0800, Davyd Madeley =D0=C9=DB=C5=D4:
> On Fri, 2005-07-08 at 05:20 +0400, Nickolay V. Shmyrev wrote:
>=20
> > > 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 ab=
out
> > > 2mm wide.
> > >=20
> > > Thoughts? Am I doing something wrong, is this expected behaviour, o=
r is
> > > this a bug somewhere in libbonoboui?
> > >=20
> >=20
> > I know it's badly documented, but isn't it what you are searching?
> >=20
> > from docs/ui-xml.txt:
> >=20
> > <control> - a control to be inserted into the status area. If
> > name=3D"main" it overrides the standard bar. Otherwise it gets packed=
into
> > the right side of the status area.
> >=20
> > 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
>=20
> 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.
>=20
> --d
>=20
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 =3D bonobo_ui_engine_build_control (sync->engine,
node);
if (widget) {
behavior_array =3D NULL;
if ((behavior =3D bonobo_ui_engine_get_attr (node=
,
cmd_node, "behavior"))) {
behavior_array =3D g_strsplit
(behavior,",", -1);
bonobo_ui_node_free_string (behavior);
}
if (behavior_array !=3D 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.