Re: [Gtk-osx-users] menu synchronisation



On Apr 4, 2010, at 2:54 PM, Olivier Sessink wrote:

> 2010/4/4 John Ralls <jralls ceridwen fremont ca us>:
>> Are you using UTF16 or UTF32? The leading zeroes in the wchars will make g_print and the NSString import routines think that you've submitted a zero-length string, because they expect single-byte characters. You can test it by transcoding the result of gtk_menu_item_get_label in your g_print statement.
> 
> Only UTF-8 (they are GTK menu items, so they have to be UTF-8). After
> more debugging I found more strange things. It seems that many labels
> are first found as NULL and later with a name:
> 
> found label 0x186e2a8 for 'H1' ('(null)')
> found label 0x186e348 for 'H2' ('(null)')
> found label 0x186e3e8 for 'H3' ('(null)')
> found label 0x0 for '(null)' ('(null)')
> found label 0x0 for '(null)' ('(null)')
> 
> next run:
> 
> found label 0x186e2a8 for 'H1' ('(null)')
> found label 0x186e348 for 'H2' ('(null)')
> found label 0x186e3e8 for 'H3' ('(null)')
> found label 0x186e488 for 'H4' ('(null)')
> found label 0x0 for '(null)' ('(null)')
> 
> does this sound logically to you? I call sync several times during
> startup (several functions that change menu's are also called during
> startup), perhaps that is related? At least it doesn't look very good
> for the performance (looping over all menu items for every menu item).
> 

Interesting, that's different from your earlier list, where you had pointers on every line, but no text in either my_label or the passed-in menuitem. It sure looks like the GtkMenuItems aren't fully initialized yet.

I think best results are obtained if you delay calling ige_mac_menu_set_menu_bar at the last possible point before returning control to the user, and then calling ige_mac_menu_sync at the end of functions that change the menu structure, again just before returning control to the user.

Regards,
John Ralls







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