T.R | Title | User | Personal Name | Date | Lines |
---|
2973.1 | GetValues wants address of pointer | R2ME2::OBRYAN | | Thu Jun 21 1990 15:25 | 20 |
|
re:.0
> char name[50];
> XtSetArg( args[0], XtNname, name);
> XtGetValues(window, args, 2 );
GetValues always produces "string addresses" for resources which are strings.
You need to supply the *address of a pointer* as the arg value, not the address
of memory in your program.
char *name; /* If XtNname is a compound, make 'char' DwtCompString*/
XtSetArg( args[0], XtNname, &name );
BTW, do not attempt to Free this memory... the widget owns it.
Good luck
|
2973.2 | tried it - no success! | STKHLM::BERGGREN | Nils Berggren SWAS/Telecom,Sweden | Mon Jun 25 1990 06:57 | 14 |
| re: .1
I tried:
char *name;
XtSetArg(args[0], XtNname, &name);
XtGetValues(...)
but it didn't work either...
What to do?
/Nils
|
2973.3 | | DWTERM::MESSENGER | | Mon Jun 25 1990 11:38 | 10 |
| Try this:
char *name;
Dimension height;
XtSetArg(args[0], XtNtitle, &name);
XtSetArg(args[1], XtNheight, &height);
XtGetValues(...);
-- Bob
|
2973.4 | XtNtitle - No success... | STKHLM::BERGGREN | Nils Berggren SWAS/Telecom,Sweden | Tue Jun 26 1990 04:07 | 4 |
| Tried it and no success. The pointer is untouched at the
XtGetValues-call.
/ Nils
|
2973.5 | | HANNAH::MESSENGER | Bob Messenger | Tue Jun 26 1990 11:22 | 10 |
| Re: .4
Can you read the height consistently by declaring it as Dimension instead of
int?
I was wrong about XtNtitle; window widgets don't have a title. I'm not sure
if it's possible to read the widget name with XtGetValues, though; "name" isn't
listed as a supported resource. Maybe one of the toolkit gurus can help.
-- Bob
|
2973.6 | XtNheight works | STKHLM::BERGGREN | Nils Berggren SWAS/Telecom,Sweden | Wed Jun 27 1990 06:18 | 5 |
| re: 5.
Yes, I get the height OK.
/Nils
|
2973.7 | XtNname is not used | R2ME2::VANGILDER | Jim V., DECwindows Toolkits | Wed Jun 27 1990 10:24 | 4 |
|
Despite the fact that XtNname is defined, it is not a supported
resource in any of the XUI widgets.
|