Re: [gtkmvc-users] Working with subviews
Brought to you by:
cavada
From: Steve M. <smc...@gm...> - 2012-05-25 22:52:17
|
On Fri, May 25, 2012 at 5:40 PM, <to...@ce...> wrote: > On 25.05.2012, at 17:26, Steve McGrath wrote: > >> This part seems to work alright, except that if a subview's controls have accelerator keys defined, I get this warning: "GtkWarning: IA__gtk_window_add_accel_group: assertion `GTK_IS_WINDOW (window)' failed" > > Accelerators only work if they're assigned to a window, since this is where keyboard events come in from the OS. > > Some of your files don't contain windows. I didn't know this was possible, I presume you started with one and then used "remove parent" in Glade. > > This is why GtkBuilder fails to set up the accelerator. Using the common tab in Glade does not make any intermediate steps (like an ActionGroup) available, so it is not possible to fix this in code. > > Even if you had dummy windows in the subview files, reparenting the widgets into the main window would break the accelerators. > > The bottom line is, the common tab will never work with subviews. You'll have to do it manually in code (like examples/uimanager) or wait for us to finish extending GTKMVC. > Ah. Actually I had just cut & pasted the subsections out of my main glade file into their own glade projects. Glade didn't complain, so I never thought to think about whether or not it was a good idea. I was guessing the problem had something to do with the subview not having its own window. I suppose I'll work on integrating UIManager into the mix, and figure out my accelerator keys from there. -Steve -- If it ain't broke, you're not using a new enough version |