pasturel@sctc.com (Pierre Pasturel) (11/05/90)
How do you set widget resources in .Xdefaults by NAME and by CLASS for widgets created in a motif application program??? The OSF/Motif 1.0 manual makes it appear obvious how to do this, but I still can't get it to work...... "To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters.... " Please use the following example in your answer: I created an application program (whose executable name is tpt if that matters) which has one application shell and one top_level shell. They are created as follows: app_shell = XtAppCreateShell ( /*in*/ "TPT", /* class name */ /*in*/ "tpt_menu", /*in*/ applicationShellWidgetClass, /*in*/ display_ptr, /*in*/ args, /*in*/ n ); help_top_level_shell = XtAppCreateShell ( /*in*/ "TPT", /*in*/ "tpt_help", /*in*/ topLevelShellWidgetClass, /*in*/ display_ptr, /*in*/ args, /*in*/ n ); According to the Xt Intrinsic manual I have, app_shell is created under class "TPT" and has a name "tpt_menu". And, help_top_level_shell is also created under class "TPT" and has a name "tpt_help." Correct so far ?? Now, lets say that I create widgets with the following widget hierarchy: app_shell | | bullentinboard with name "bb1" | | pushbutton w/ name "button1" AND help_top_level_shell | | bullentinboard with name "bb2" | | pushbutton w/ name "button2" My general question is: How do you set resources for particular widgets in these widget trees ? For example, how do I set the XmNiconic resource of my app_shell "tpt_menu" to True so that the bb1 window is iconified when I start my application program This successfully worked when I set the resource using XtSetArg in my application program. I tried this w/ no success: mwm*tpt_menu*Niconic: True I also tried: mwm*tpt_menu*niconic: True mwm*tpt_menu*iconic: True What am I doing wrong? As a related question, then, how would I specify (define) the color to be blue in the .Xdefaults file for button2? I would think that its something like this: mwm*tpt_help*bb2*button2.Nforeground: Blue I did successfully specify the following in .Xdefaults: Mwm*TPT*iconImage: sctc_logo.xbm mwm*tpt_menu*iconImage: sctc_logo.xbm however, the following did not work: mwm*tpt_help*iconImage: term.xbm Is there something particular about specifying resources for top level shell widgets? Thanks for any help. Pierre