Re: Hidable rulers


Subject: Re: Hidable rulers
sterwill@abisource.com
Date: Thu Dec 02 1999 - 08:54:47 CST


Stephen Hack wrote:
> the getState is fine, but the i'm not sure about the others. I've not changed
> any of the EditMethods viewRuler calling, so ... ??? I'm seeing the traces,
> but not having the ruler actually changed unless I click it. (only on unix)

I sat down with gdb last night and found the problem. Whenever a menu
is clicked (any menu, something like "Help"), the menu code goes through
and refreshes all the menus, so that it's sure the menu it will need to
pop up will contain the correct values for any dynamic items. Doing so
makes a run through the View menu (the one that holds "Show rulers")
even if View wasn't the menu chosen.

In the refreshMenu function (I'm not sure on function name specifics here,
I just woke up) there's a chunk that (1) reads what the current menu
item _should_ look like and (2) sets it. In the case of check menu items
it calls something like:

        gtk_check_menu_set_active(GTK_CHECK_MENU_ITEM(item), bCheck);

That function then triggers the "activate" signal, which (to GTK) is just
like a user clicking on the Hide Rulers menu item.

So every time any menu is refreshed, the Hide Rulers option is "set" again
to its proper value, just in-case it changed (through some other code path)
since the last time the menus were displayed.

This is a bug in the menu code. It needs to be totally refactored on the
Unix side (where it interfaces with GTK). It was written long ago, before
GTK had menus like it does now, but has just been patched whenever they
changed stuff.

I'll volunteer to do that clean-up (since I wrote most of the original code)
if there isn't another short-term solution for this problem. :)

-- 
Shaw Terwilliger



This archive was generated by hypermail 2b25 : Thu Dec 02 1999 - 08:54:47 CST