Re: UIManager and dynamic menus
- From: Frank Naumann <fnaumann boerde de>
- To: Gtkmm Mailing List <gtkmm-list gnome org>
- Subject: Re: UIManager and dynamic menus
- Date: Wed, 4 Apr 2007 19:37:59 +0200 (CEST)
Hello!
For me, I'll be using this from within a plugin context, so each
plugin will get handed a UIManagerMerge object, and add what it needs
to the ui. Then when the plugin goes away, all of its menu stuff goes
away cleanly as well. The only thing I can't get around is the path
issue. As it is, I'd have to make each of my plugins 'know' the path
through the ui stuff. I did think about making it so that the
UIManagerMerge object could get constructed with a base path, so that
all additions get put below a certain path, but that ixnay's the
ability to add to multiple menus in the UI.
I'll work on fleshing this out a bit more, if anyone else has some
insights, feel free to shout out. I'll post some code when I get to
that point.
I use add_ui_from_string() and remove_ui() and for me it's very easy. I
use it for a recent file submenu (e.g. File -> Recent Files -> 1: ...,
2:...).
I pass the path head and tail to the object that manage the recent files.
On merge it construct then the ui string dynamically. So it can be used at
any place in the ui.
Regards,
Frank
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]