Building menus with UIManager



Hi,
I'm trying to port a hard coded gtk menu to the "new" UIManager and
GTK_Actions approach. The code is written in ada but I'm using the c
docs to get the ideas and than I try to write the ada code. 
After googleing around I found enough docs to get the basic menu up and
running. But there are two questions remaining.

1) Is there a possibility to determine where an action was triggered?
Simple example: I want to provide an openfile action and I have two
different kind of windows (A and B). Each window type is able to
open a file but the file types are different (a and b). The easy way is
to add an openfilea and openfileb action but this allows the user to add
the wrong action (openfileb) to the Window of type A. Therefor I would
like to determine the path of the widget (eg. "/menubarA" or
"/menubarB").

2.) How to realize a recent file submenu?
What is the best and easiest way to realize a recent file submenu? I've
added an empty menu in the xml and "unset" the hide_if_empty
property of the action. I've noticed that the activate action is
triggered while the submenu opens. Do I have to merge new menu items in
the callback routine? But then I've to determine where the action was
triggered since the position of the recent file menu can change.

Thanks in advance
Bernhard


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