gal@cs.nott.ac.uk (Graeme Lunt) (05/31/89)
(Chomp chomp chomp) I have come across a problem with Application Contexts and Translation Management. It is to do with the predefined actions MenuPop{up,down}. I can't believe nobody else has come across this problem - if they have and this has been mentioned before, or I'm missing something glaringly obvious, have patience. The scenario is this: I call XtToolkitInitialize() which eventually calls. _XtPopupInitialize() which adds the actions MenuPopup and MenuPopdown to the default AppContext - if there isn't a default AppContext, one is created. I then create my own AppContext using XtCreateApplicationContext() and register some actions with it using XtAppAddActions() using my AppContext (seem reasonable ?). I build up some Translations that use my new actions and the MenuPopup action. The widget I attach the translations to has my AppContext. When the Intrinsics come to bind the actions it cannot find MenuPopup as that action has been registered with a different AppContext - the default one - and not the AppContext of my widget. I can get rid of the problem if I replace my call to XtCreateApplicationContext() to _XtDefaultApplicationContext() - all actions are registered with the same AppContext. This means any widget that uses the MenuPop{up,down} has to belong to the default AppContext created by the Intriniscs and not by me. Is this the right behaviour ? Should I have a handle into the Intrinsics so I can include the MenuPop{up,down} actions into my AppContext ? When if an action is unbound from the widgets AppContext should the Intrinsics try to bind it from the default AppContext ? Should XtCreateApplicationContext() be called before XtToolkitInitialize(), and make the newly created AppContext the default ? I can live with my fix at the moment but what happens when (if) I need more than one AppContext ? Comments ? Graeme Lunt Communications Research Group Computer Science Department University of Nottingham ENGLAND (Obligatory mention of R4: Is this addressed in R4 ? 8-)