Discussion:
XmNlabelString
(too old to reply)
vmnithin
2006-11-08 05:57:46 UTC
Permalink
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
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);
}


with Regards
NithinVM
The Ghost In The Machine
2006-11-09 02:48:20 UTC
Permalink
In comp.windows.x.intrinsics, vmnithin
<***@gmail.com>
wrote
on 7 Nov 2006 21:57:46 -0800
Post by vmnithin
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
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);
}
with Regards
NithinVM
An XrmDatabase can be had from the call XtDatabase() or
XtScreenDatabase() (declared in Intrinsic.h); once you have that,
you can try XrmGetResource() (declared in Xresource.h). You'll
need an XrmNameList == XrmQuarkList; you can get this from
XrmStringToQuarkList.

(I'll admit I don't know precisely how well all this will work, but
that's what a read of the include files suggests.)
--
#191, ***@earthlink.net
Q: "Why is my computer doing that?"
A: "Don't do that and you'll be fine."
--
Posted via a free Usenet account from http://www.teranews.com
Loading...