[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Should <Menu> be a KActionMenu
From: David Faure <david () mandrakesoft ! com>
Date: 2002-02-02 23:19:47
[Download RAW message or body]
On Wednesday 30 January 2002 06:01, Benjamin Meyer wrote:
> Someone please point the out if any of this is wrong. (see previous post on
> needing more documentation in KAction, etc)
>
> To have a menu that is partially static and partially dynamic ( my example
> being in my im client there is a menu that lists away messages. Users can
> add and remove away messages from this list as will is that dynamic part and
> the static part is an action to add new messages. ) you can not layout this
> menu using xmlui and KActions. Currently the only way to do it is to make
an
> action (that is a KActionMenu) and fill it in manually within the code of
the
> app.
>
> I have been able to come up with 2 ways to get access to a menu and using
the
> ui.rc The first is a call to the guiFactory, which will return a KPopupMenu
> for example: (KPopupMenu *)guiFactory()->container("away_menu", this); This
> solution allows you to use the ui.rc file to manage the menu, but doesn't
> allow you to add/remove KActions to the menu, only normal KPopupMenu stuff.
>
> The second is to create a KActionMenu in place of the entire submenu in the
> ui.rc file and within the code creat all of the KAction's (for that menu)
and
> manually enter them into said KActionMenu. You have control of where the
> menu goes via the ui.rc file, but not control the placement of the items in
> the menu in the ui.rc file.
Third solution: use a KActionList for the dynamic items.
> From what I can gather when the ui.rc file is parsed it doesn't make
> KActionMenu's, but in fact just makes KPopupMenu's where a <Menu> tag is
> inserted.
Right, <Menu> is a container, not an action. Just like <ToolBar>.
KActionMenu is an "action", since it gets plugged into the gui, by name.
> Am I wrong to think that we should have createGUI() use KActionMenu's and
not
> KPopupMenu's?
Yes, for the reason above.
> If everyone thinks that this is a bad idea we should at least put a note in
> the KActionMenu stating that it is not what is used by the xmlui for <Menu>.
Patch welcome.
--
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david, http://www.konqueror.org
KDE 3.0: Konquering the Desktops
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic