global motif widget setting - Motif

This is a discussion on global motif widget setting - Motif ; Hello all, I face following situation: we have one ancient application that does not allow to change and permanelty store the values of the widget settings in its resource file(GraphInclination, GraphRotation etc.). I would like to attempt to set this ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: global motif widget setting

  1. global motif widget setting

    Hello all,
    I face following situation:
    we have one ancient application that does not allow to change and
    permanelty store the values of the widget settings in its resource
    file(GraphInclination, GraphRotation etc.). I would like to attempt to
    set this values globally as environment justifies it (dedicated
    workstation, no other users etc.). So my question would be:
    Is it possible to set widget properties globally in such a way that
    widgets are rendered as prescribed by global setting
    and not as hard-coded somewhere in the application?


    /wbr
    Ariel Burbaickij


  2. Re: global motif widget setting

    pustota1 wrote:
    > Hello all,
    > I face following situation:
    > we have one ancient application that does not allow to change and
    > permanelty store the values of the widget settings in its resource
    > file(GraphInclination, GraphRotation etc.). I would like to attempt to
    > set this values globally as environment justifies it (dedicated
    > workstation, no other users etc.). So my question would be:
    > Is it possible to set widget properties globally in such a way that
    > widgets are rendered as prescribed by global setting
    > and not as hard-coded somewhere in the application?


    If the application only (or mostly) uses rdb to set the widget
    properties (like read them from .Xdefaults), then it is possible.

    But if the application subsequently sets some resources
    programmatically, then it is very difficult to force these
    values to your vales. You could only do it with a mechanism
    used by editres (source available). But the application needs
    to support editres. Mostly editres support is enabled by
    default, while some secretive applications may wish to
    disable it.

    Hope this helps,

    Dušan Peterc
    http://www.arahne.si

  3. Re: global motif widget setting


    "arahne" wrote in message
    news:lfkFh.478$553.426583@news.siol.net...
    > pustota1 wrote:
    >> Hello all,
    >> I face following situation:
    >> we have one ancient application that does not allow to change and
    >> permanelty store the values of the widget settings in its resource
    >> file(GraphInclination, GraphRotation etc.). I would like to attempt to
    >> set this values globally as environment justifies it (dedicated
    >> workstation, no other users etc.). So my question would be:
    >> Is it possible to set widget properties globally in such a way that
    >> widgets are rendered as prescribed by global setting
    >> and not as hard-coded somewhere in the application?

    >
    > If the application only (or mostly) uses rdb to set the widget
    > properties (like read them from .Xdefaults), then it is possible.
    >
    > But if the application subsequently sets some resources
    > programmatically, then it is very difficult to force these
    > values to your vales. You could only do it with a mechanism
    > used by editres (source available). But the application needs
    > to support editres. Mostly editres support is enabled by
    > default, while some secretive applications may wish to
    > disable it.


    No, editres is not enabled by defalut. It is enabled by including
    #include
    and then adding this in the code for every shell widget:
    XtAddEventHandler(shell, 0, True, _XEditResCheckMessages,0);

    Most commercial applications do NOT include this.

    Even if you do include editres functionality in your program,
    it cannot be used to reset create-only resources.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Aero Stability and Controls Computing



  4. Re: global motif widget setting

    Hello Fred and Dusan,
    thank you for your answers,
    I am not any expert in Motif, so my assumption about how it works
    is as follows:
    We have Motif engine that renders widgets deliver events etc, etc.
    what
    one would expect from reasonable GUI environment. Then we have
    different
    applications that can request special shape, position, rotation --
    whatever
    from the engine. If the engine is able to satisfy the request from the
    application
    then it does so, if it not able to satisfy the request as specified
    then at least
    default values for properties are returned. Default values for
    properties are specified
    in some global file. Is my understanding to this point correct? If
    yes, I would like to
    set this global default values. If not, does some other mechanism
    exist that would
    allow us to forcefully override the values as used by application.
    Actually, the application
    itself does not support editres.
    On 28 , 20:34, "Fred Kleinschmidt"
    wrote:
    > "arahne" wrote in message
    >
    > news:lfkFh.478$553.426583@news.siol.net...
    >
    >
    >
    > > pustota1 wrote:
    > >> Hello all,
    > >> I face following situation:
    > >> we have one ancient application that does not allow to change and
    > >> permanelty store the values of the widget settings in its resource
    > >> file(GraphInclination, GraphRotation etc.). I would like to attempt to
    > >> set this values globally as environment justifies it (dedicated
    > >> workstation, no other users etc.). So my question would be:
    > >> Is it possible to set widget properties globally in such a way that
    > >> widgets are rendered as prescribed by global setting
    > >> and not as hard-coded somewhere in the application?

    >
    > > If the application only (or mostly) uses rdb to set the widget
    > > properties (like read them from .Xdefaults), then it is possible.

    >
    > > But if the application subsequently sets some resources
    > > programmatically, then it is very difficult to force these
    > > values to your vales. You could only do it with a mechanism
    > > used by editres (source available). But the application needs
    > > to support editres. Mostly editres support is enabled by
    > > default, while some secretive applications may wish to
    > > disable it.

    >
    > No, editres is not enabled by defalut. It is enabled by including
    > #include
    > and then adding this in the code for every shell widget:
    > XtAddEventHandler(shell, 0, True, _XEditResCheckMessages,0);
    >
    > Most commercial applications do NOT include this.
    >
    > Even if you do include editres functionality in your program,
    > it cannot be used to reset create-only resources.
    > --
    > Fred L. Kleinschmidt
    > Boeing Associate Technical Fellow
    > Aero Stability and Controls Computing




  5. Re: global motif widget setting


    "pustota1" wrote in message
    news:1172743374.314392.95750@t69g2000cwt.googlegro ups.com...
    > Hello Fred and Dusan,
    > thank you for your answers,
    > I am not any expert in Motif, so my assumption about how it works
    > is as follows:
    > We have Motif engine that renders widgets deliver events etc, etc.
    > what
    > one would expect from reasonable GUI environment. Then we have
    > different
    > applications that can request special shape, position, rotation --
    > whatever
    > from the engine. If the engine is able to satisfy the request from the
    > application
    > then it does so, if it not able to satisfy the request as specified
    > then at least
    > default values for properties are returned. Default values for
    > properties are specified
    > in some global file. Is my understanding to this point correct? If
    > yes, I would like to
    > set this global default values. If not, does some other mechanism
    > exist that would
    > allow us to forcefully override the values as used by application.
    > Actually, the application
    > itself does not support editres.


    Motif widgets get resource values from multiple sources, all of which
    have a different level of precedence. From highest to lowest:
    1. Anything hard-coded in the source code cannot be overridden.
    2. Any options specified on the execution command line (-xrm flags).
    3. Resources specified in the resource file identified by
    the XENVIRONMENT environment variable, or, if it is undefiuned,.
    resources specified in file $HOME/.Xdefaults-hostname
    4. Resources specified by the RESOURCE_MANAGER property,
    or, if it is not defined, in file $HOME/.XDefaults
    5. lots more other files
    6. Finally, by resources specified in the fallback parameter
    passed to XtAppInitialize().

    For full details, see O'Reilly Volume 4.

    The best one to try is set (and export) XENVIRONMENT to
    some file name, and specify the values you want there. For example,
    to set all backgrounds to pink, you could use
    ?*background: pink
    Or to set all pushbutton text color to red:
    ?*XmPushButton.background: red

    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Aero Stability and Controls Computing





  6. Re: global motif widget setting

    Perfect answer, Fred. Many thanks.

    /wbr
    Ariel Burbaickij


  7. Re: global motif widget setting

    Fred Kleinschmidt wrote:

    > No, editres is not enabled by defalut. It is enabled by including
    > #include
    > and then adding this in the code for every shell widget:
    > XtAddEventHandler(shell, 0, True, _XEditResCheckMessages,0);


    Editres is enabled by default on OpenMotif and LessTif.
    On those versions of Motif, you do not need to include or call anything.
    So if you use Linux, you probably have an editres enabled
    application.

    On workstation (HP, IBM, Sun) versions of Unix / Motif
    (OSF/Motif 2.1.30 or older), which I presume you at
    Boeing use, the editres is disabled.

    Other than that, I agree with what you say.

    Best regards,

    Duan Peterc
    http://www.arahne.si

+ Reply to Thread