Trying to get custom Bonobo tool bar controls & standard buttons to match appearance



In the Nautilus tool bar are Back and Forward buttons. These buttons are
intended to look and act exactly like other tool bar buttons, with one
difference: right-clicking on them gives a pop-up menu.

I could find no way to get access to the right-click event with a normal
Bonobo tool bar item, so I made a control and embedded within it my own
widget. I made my widget be a BonoboUIToolbarButtonItem, so that I could
share as much code as possible with standard Bonobo tool bar items, and
thus minimize differences.

This works pretty well, but one place where it fails is in the
BonoboUIToolbarItemStyle. My widget doesn't have this style set when the
standard tool bar buttons do, and I haven't found any way for my widget
to determine what style is used by standard tool bar buttons. And when
the style changes (e.g. when a dragged-off tool bar is made vertical),
my widget doesn't react.

Perhaps there's already the right mechanism in here for me to hook into,
but I just didn't notice it? Or is this a known design problem in
Bonobo, where controls don't get notified/updated the way standard tool
bar buttons do?

Unless there's a way to do this that I didn't realize, my plan is to
duplicate enough logic to get the initial style right, and punt on the
fact that style changes in the lifetime of the tool bar won't affect my
widget.

John





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