Submitted by Anonymous on Wed, 12/19/2001 - 07:47. Developers
Hi,
I have two basic doubts.
1. Is it possible to have a button whose label (name) can be changed depending on some some flag?? . (like ON and OFF), If so, Please tell me how can i do that??
2. How can i open a file from the X/Motif GUI ??
It`s appreciable if you can reply me with an example..
Thanks in adv,
vara
1) Use XtSetValues to change the XmNlabelString of the XmLabel or XmPushButton in question. You need to pass an XmString value.
2) Use the underlying operating system calls e.g. fopen() or whatever is on your system. Motif deals with the user-application interface, not with file system calls.
Hi dbl,
Let me more clear about my requirement. I have a X/Motif application running on Unix ,
I want to open a log file on some action performed in the GUI ( like a menu option is selected or button is clicked..)
Do i have to use sys call to open this file from GUI?? If so, how can i execute the sys call in a motif program??
Can i do this with exec sys call ?? Is there any other way to do it??
Thanks for ur help,
vara
Really, it sounds to me like you want fopen() to return a file handle, and then fprintf() every time you want to log something to that file. The file pointer can go into a data structure that you pass around.