Thread View: comp.graphics.explorer
2 messages
2 total messages
Started by John Hagedorn
Wed, 04 Nov 1992 17:13
Can I set file browser widget?
Author: John Hagedorn
Date: Wed, 04 Nov 1992 17:13
Date: Wed, 04 Nov 1992 17:13
36 lines
1571 bytes
1571 bytes
Is there a way of setting the selection of a file browser widget from
my program? On module initialization, I want to set the directory to
the current working directory. I have tried this code:
store_frames_init ()
{
char curr_dir[256];
if ( getcwd (curr_dir, 256) == NULL)
{
return -1;
}
strcat (curr_dir, "/*");
cxInWdgtStrSet ("Frame File", curr_dir);
return 0;
} /* end of store_frames_init */
(Where "Frame File" is the name of the input port assiated with the
file browser.)
I find that this code properly sets the "Selection" string and
the "Contents" window shows the contents of the current directory,
but the directory menu is not updated to show the current
directory.
Is this a bug in cxInWdgtStrSet, or should I not be trying to use
it for this purpose? Is there another way to achieve this?
Thanks.
John Hagedorn hagedorn@betsy.gsfc.nasa.gov (301) 286-7374
Re: Can I set file browser widget?
Author: Jim Patterson
Date: Mon, 09 Nov 1992 16:29
Date: Mon, 09 Nov 1992 16:29
31 lines
1548 bytes
1548 bytes
John Hagedorn (hagedorn@betsy.gsfc.nasa.gov) wrote:
:
: Is there a way of setting the selection of a file browser widget from
: my program? On module initialization, I want to set the directory to
: the current working directory. I have tried this code:
:
: store_frames_init ()
: {
: char curr_dir[256];
:
: if ( getcwd (curr_dir, 256) == NULL)
: {
: return -1;
: }
:
: strcat (curr_dir, "/*");
I think the problem is adding the * to the end of the directory. The
explorer widget doesn't know how to deal with the wildcard. I have
successfully set the directory by using "./".
Hope this helps,
Jim
--
--
James Patterson photon!jhp@ucsd.edu jhp@photon.com
Photon Research Associates 619-455-9741 (voice) 619-546-3903 (fax)
"... three great virtues of a programmer: laziness,impatience and hubris "
Larry Wall in _Programming Perl_
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads