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