[Glade-users] Spacing widgets on menu bar

Jeffrey Barish wrote:

Yes! ?This works and is much easier than writing a size handler.

The suggestion from Alexey is also interesting and basically works. ?I
added a generic item to the toolbar and then added a menu bar from the
palette to that item. ?However, the color of the menu bar's background is
different from the color of the toolbar's background, so there is a
discontinuity that doesn't look right. ?I imagine that there is a way to
adjust the background color, but the suggestion from Tristan is working

I spoke too soon.  The solution from Tristan certainly looks right -- hence
my initial enthusiasm -- but it does not behave right.  My problem is that
two of the items in my UI design need to be image buttons, not image menu
items.  Image menu items normally produce popup menus when actuated, which
I don't want.  I assumed that I would be able to get the image menu items
to behave like image buttons, but I have not succeeded.  Deleting the menu
is not sufficient as the items still cycle through the select and activate
states as if there were a menu present.  I tried many things, including
emitting a button-press-event on button selection to dismiss the
nonexistent menu by simulating a second mouse button click.

The other approach I explored was changing the background color in Alexey's
solution so that the background is continuous.  The buttons do not have a
background, so I either have to give them a background whose color I can
adjust or I have to change the background color of the menubar to the
background color of the window.  It seems as if the latter approach would
be easy, but menu bars are mysterious.  The background seems to comprise
two layers, a "true" background and a gradient.  To get the menu bar to
match the rest of the tool bar, I need to get rid of the gradient.  Simply
setting the background color does not work because we view the background
through the filter of the gradient.  Gradient does not appear in gtk.Style,
so I wonder whether I am hallucinating, but I did measure a gradient using
the color picker in Gimp and I can see it when I set the background of the
menubar and the background of the main window to the same color.

I would also be happy (happier, in fact) to extend the background of the
menu bar.  Documentation says that I can put the buttons in an event box
and then set the background color of the event box.  However, I will have
the inverse problem with this approach: I will need to impose a gradient to
match the gradient in the menu bar.

Jeffrey Barish

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