- I reduced the font size of the labels and spinbuttons, but could not
do
that for the units menu. It looks like menus font sizes are not
settable.
Any insights from gtk experts? Because of the too-large units menu, the
aux
toolbar jumps up and down a bit when you switch tools.
You need to set the font size for each menuitem. The OptionMenu just sizes to fit its menuitems.
Still does not work :( Just after
i = gtk_menu_item_new_with_label ( u->abbr );
in units-menu.cpp I added
gtk_widget_modify_font (i, pan);
where pan is a PangoFontDescription. No visible effect, although the same approach works for spinbuttons.
Mmm, I think the units menu works best as an optionmenu.
OK, let's leave it as is for now
As for changing the context menus for spinbuttons, at worst I guess you can add signal handlers for the "button-press-event" and "button-release-event" signals and trap right clicks that way.
And if I just want to remove something from the standard menu? Impossible?
I still have mixed feelings about removing the standard context menus, though :/
Why would one need any special input methods for typing digits?
- I want Esc inside the spinbutton to defocus it. Now Enter applies the
value and defocuses, but this is only because it's hard-coded into the spinbutton to "activate" it and I added defocusing to the value-changed callback. However I don't see how I can change the keybindings within a spinbutton to enable Esc to do what I want. Is this possible at all?
Yes; connect to the widget's "key-press-event" and "key-release-event" signals to trap keypresses.
Thanks, this works, except that deficusing a spinbutton activates it, i.e. applies its value to scale/move. Obviously this is wrong for Esc, which must cancel any changes and restore the old value. But I did not find any way to "undo" a GtkEditable. Does this mean I must implement this myself, by remembering the old text every time I enter a spinbutton and restoring it when leaving by Esc?
_________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=dept/bcomm&pgmarket=en-ca&RU=http%3a%2f%2f...
On Mon, 2004-01-05 at 03:13, bulia byak wrote:
You need to set the font size for each menuitem. The OptionMenu just sizes to fit its menuitems.
Still does not work :( Just after
i = gtk_menu_item_new_with_label ( u->abbr );
in units-menu.cpp I added
gtk_widget_modify_font (i, pan);
where pan is a PangoFontDescription. No visible effect, although the same approach works for spinbuttons.
Well, remember that gtk menuitems are containers (GtkBins, actually); when you use gtk_menu_item_new_with_label(), that creates a GtkLabel widget and places that in the newly created menuitem.
So you'll need to use gtk_bin_get_child() to get at the label widget for the GtkMenuItem and set the font on that.
It would be nice if there was a recursive version of gtk_widget_modify_font(), but as far as I know there isn't. Perhaps we should write a function to do that.
As for changing the context menus for spinbuttons, at worst I guess you can add signal handlers for the "button-press-event" and "button-release-event" signals and trap right clicks that way.
And if I just want to remove something from the standard menu? Impossible?
More or less. I don't think there is currently any public means of hooking the standard context menu, so you'd have to just replace it with your own.
I still have mixed feelings about removing the standard context menus, though :/
Why would one need any special input methods for typing digits?
Well, the user might have a sepcial input method selected, and they want to switch back to one that is more convenient for typing digits. Perhaps. That's admittedly stretching it.
But I did not find any way to "undo" a GtkEditable. Does this mean I must implement this myself, by remembering the old text every time I enter a spinbutton and restoring it when leaving by Esc?
Yes.
You may find that g_object_get_data() and g_object_set_data() will save your sanity here.
Or perhaps it might be worthwhile subclassing the spincontrols in the long run; I dunno.
-mental
participants (2)
-
bulia byak
-
MenTaLguY