Re: Configuring Toolbars with BononboUI
- From: Gustavo Carneiro <gjc inescporto pt>
- To: Michael Meeks <michael ximian com>
- Cc: bonobo <gnome-components-list gnome org>
- Subject: Re: Configuring Toolbars with BononboUI
- Date: 09 Sep 2002 11:08:02 +0100
On Mon, 2002-09-09 at 10:37, Michael Meeks wrote:
> Hi Gustavo,
>
> On Sun, 2002-09-08 at 14:21, Gustavo J A M Carneiro wrote:
> > I have spent almost two days trying to solve this simple problem.
>
> I'm sorry about that; ask questions earlier, this one is quite simple.
Don't worry. I spent little time programming each day. Besides, I got
to know a little better bonoboui code :)
>
> > If the user right-clicks on the toolbar, a menu appears giving it the
> > option to hide the toolbar. However, once hidden, there is no way to
> > bring it back without changing a gconf key.
>
> Right;
>
> > I would like to include a menu item (View->Tool Bar), to show/hide the
> > toolbar. How can I do that? I mean I know how to create a toggle menu
> > item, listen for state changes, etc., but how do I programatically show
> > or hide the toolbar. For the status bar it was easy: just set the
> > 'hidden' property on /status:
> > bonobo_ui_component_set_prop(component, "/status", "hidden",
> > visible? "0" : "1", NULL);
> >
> > But for the toolbar it doesn't work. Maybe it's because I don't know the
> > correct path, because it is not documented?
>
> Nope; it's because as you set the path - it is clobbered internally by
> the configuration mechanism and hidden again :-)
>
> The way the configuration works is this: as you change a node, it's
> looked up in the config hash which has a list of properties which are
> 'clobbered' on it - and these are set to the stored values.
>
> You really want to add a menu item with the builtin verb
> 'BonoboCustomize' that magically should do what you want [ albeit with a
> somewhat ugly GUI ].
I don't think it's that ugly! :) Although I can notice that, according
to the Gnome HIG, the frames should be replaced with bold labels and
indentation ;)
Thanks it worked! To tell you the truth, I *almost* figured that out
by myself. I saw that there was a BonoboCustomize verb, but in the UI
XML file I forgot to give a label to the menu item and it didn't show
up. Other menu items rely on the <command> to give the label... I just
thought I was doing the wrong approach.
BTW, this specific question is very important. I think it should be in
the ui-faq. In fact, this patch in attachment would do just that...
>
> The question as to how best to abstract / expose the customization
> information is a difficult one. I'd be most pleased if you could come up
> with a design / a set of thoughts on how to do this.
I'm just a beginner with BonoboUI, as you surely have concluded by
now, so I don't have enough information to suggest anything. But I I'll
be able to come up with suggestions in time for Gnome 2.2 ...
One thing is for sure. Customization information needs to be exposed
somehow. It seems that all that API is either not present in the public
header files or guarded as "internal", and that is not good.
--
Gustavo Joćo Alves Marques Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>
Index: ui-faq.txt
===================================================================
RCS file: /cvs/gnome/libbonoboui/doc/ui-faq.txt,v
retrieving revision 1.1
diff -u -r1.1 ui-faq.txt
--- ui-faq.txt 2001/07/12 18:12:38 1.1
+++ ui-faq.txt 2002/09/09 10:02:28
@@ -273,3 +273,9 @@
same radio verbs, but they cannot share the same group.
+* How do I let the user customize a toolbar once it's hidden?
+
+ You really want to add a menu item with the builtin verb
+'BonoboCustomize' that magically should do what you want.
+
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]