Resetting the Resourse value from the Resource file after creating the widget. - Motif

This is a discussion on Resetting the Resourse value from the Resource file after creating the widget. - Motif ; Hello, I created a LABEL widget using XtVaCreateWidget function. Now I want to update the XmNlabelString fom another function in which I will pass a string and I want to fetch the corresponding entry from the Resource file which cant ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Resetting the Resourse value from the Resource file after creating the widget.

  1. Resetting the Resourse value from the Resource file after creating the widget.

    Hello,

    I created a LABEL widget using XtVaCreateWidget function.
    Now I want to update the XmNlabelString fom another function in which I
    will pass a string and I want to fetch the corresponding entry from the
    Resource file which cant be done by the XtVaSetValues function. Please
    hel[p me to find a solution

    with Regards
    NithinVM


  2. Re: Resetting the Resourse value from the Resource file after creating the widget.

    What do you mean by this - " I want to fetch the corresponding entry
    from the
    > Resource file "


    vmnithin@gmail.com wrote:
    > Hello,
    >
    > I created a LABEL widget using XtVaCreateWidget function.
    > Now I want to update the XmNlabelString fom another function in which I
    > will pass a string and I want to fetch the corresponding entry from the
    > Resource file which cant be done by the XtVaSetValues function. Please
    > hel[p me to find a solution
    >
    > with Regards
    > NithinVM



  3. Re: Resetting the Resourse value from the Resource file after creating the widget.

    I mean for example the string I passed to the function is "quit" and
    the corresponding entry in the Resource file is " *quit.labelString
    : EXIT ".
    Now I want the label to be updated as "EXIT".
    This can be done at the time of creation fo widget by using the
    XtVaCreateWidget().
    But for me I want to update an already created widget.
    I cant use XtVaSetValues because it takes the string directly as
    void setString(const char *s)
    {
    xmstr = XmStringCreateLocalized( (char *)s ); //I want a method to
    load from Resource file
    XtVaSetValues( Widget,
    XmNlabelString,xmstr,
    NULL );
    XmStringFree(xmstr);
    }



    Twister.Net wrote:
    > What do you mean by this - " I want to fetch the corresponding entry
    > from the
    > > Resource file "



  4. Re: Resetting the Resourse value from the Resource file after creatingthe widget.

    vmnithin wrote:
    > I mean for example the string I passed to the function is "quit" and
    > the corresponding entry in the Resource file is " *quit.labelString
    > : EXIT ".
    > Now I want the label to be updated as "EXIT".
    > This can be done at the time of creation fo widget by using the
    > XtVaCreateWidget().
    > But for me I want to update an already created widget.
    > I cant use XtVaSetValues because it takes the string directly as
    > void setString(const char *s)
    > {
    > xmstr = XmStringCreateLocalized( (char *)s ); //I want a method to
    > load from Resource file
    > XtVaSetValues( Widget,
    > XmNlabelString,xmstr,
    > NULL );
    > XmStringFree(xmstr);
    > }


    In your example, "quit" is the name of a widget and, if the application
    can find the resource file on startup, it will set that widget's
    labelString to "EXIT". I'm guessing you want a way to switch between
    resource files on the fly in a running application.

    AFAIK, you will have to write your own resource file parser to do this
    (well, in principle you could wade through the Xt/Xrm sources to find
    the original parser I guess).

    You'll probably be better off using another configuration file format
    from which to read name/value pairs.

    --
    Per Espen Hagen
    To reply by mail, replace TLD with cc

+ Reply to Thread