[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2845.0. "File selection widget - some questions...." by PEACHS::BELDIN () Thu May 31 1990 17:13

	A customer called in with some questions about the file
	selection widget.  I think that some of these are achievable
	under 5.3, using the new callbacks file_to_extern_proc,
	file_to_intern_proc, mask_to_extern_proc, mask_to_intern_proc
	but, not having used them, I can't be sure. Maybe someone
	could enlighten me (an example would be great).

1.  Can he list the files without full directory path.

	file_to_extern_proc ? I think....	

2.  Can he set the number of pixels between between lines of text?

	I don't think so - I think it is the font

3.  Can he have the file selection widget come up scrolled all the
way to the left instead of the right?

	?

4.  How does the file_search_proc argument work?  how to use it?

	?

5.  Can he have more than one file per line?

	possibly with file_to_extern_proc?


	Thanks in advance...

	Rick Beldin
T.RTitleUserPersonal
Name
DateLines
2845.1answersR2ME2::VANGILDERJim V., DECwindows ToolkitsTue Jun 05 1990 13:0771
Sorry, I don't have an example, but I'll try to answer the questions.


>1.  Can he list the files without full directory path.
>
>	file_to_extern_proc ? I think....	
>
Right.  file_to_extern_proc will let him display whatever name he
wants.

>2.  Can he set the number of pixels between between lines of text?
>
>	I don't think so - I think it is the font
>
Try the DwtNspacing resource (documented under list box).


>3.  Can he have the file selection widget come up scrolled all the
>way to the left instead of the right?
>
No, but if he uses file_to_extern_proc to eliminate the directory
path, then this probably isn't necessary.


>4.  How does the file_search_proc argument work?  how to use it?
>

It's in the documentation, but I'll reproduce it here:

|A directory search procedure to replace the default file selection
|search procedure.  The file selection widget's default file search
|procedure is written to fill the needs of most applications.  However,
|since it is impossible to cover the requirements of all applications,
|the default search procedure can be replaced.
|
|The file_search_proc is called with two arguments: one argument is
|the file selection widget; the other argument is the file selection
|callback structure.  The callback structure contains all required
|information to conduct a directory search, including the current
|file search mask.  Once called, it is up to the search routine to
|generate a new list of files and update the file selection widget by
|using the instrinsic routine SET VALUES.  The following attributes
|must be set:
|  - items (DwtNitems) 
|	Sets the item attribute described in the low-level routine
|	SELECTION CREATE.  Set the attribute to the new list of
|	files.  If there are no files, set the attribute to NULL.
|  - items_count (DwtNitemsCount)
|	Sets the items_count attribute described in the low-level
|	routine SELECTION CREATE.  If there are no files, set
|	items_count to zero.
|  - list_updated (DwtNlistUpdated)
|	Always set the list_update attribute to true when updating
|	the file list through a search procedure, even if there are
|	no files.  The default is false.
|Setting the following field is optional, but recommended:
|  - dir_spec (DwtNdirSpec)
|	Set to the full file specification of the directory searched.
|	The directory specification is displayed above the list box.


>5.  Can he have more than one file per line?
>
>	possibly with file_to_extern_proc?

Well, using file_to_extern_proc, he could display anything on the line
that he wants, but since file select uses a list box to display the
lines, he can still only select a full line.  There wouldn't be any
way to select only one of the files if he had multiple files per
line.

2845.2Thanks - a real helpPEACHS::BELDINWed Jun 06 1990 09:355

	Thanks a lot for the help.  

	Rick Beldin
2845.3file_to_extern_proc: How is it used??RHETT::KNORRCarolina BlueFri Jun 22 1990 14:2032
    I have a customer struggling to use the new attributes made available
    for the File Selection Widget.  (file_to_extern_proc,
    file_to_intern_proc, mask_to_extern_proc, and mask_to_intern_proc.)
    As it turns out, I'm struggling as well. 
    
    The documentation for how to use these is in the VMS DECwindows
    Programming Documentation Supplement (pgs 14-31, 14-32), but it doesn't
    give (in my opinion) a very clear explanation of how to use it.
    
    What I've done at this point is to define a VoidProc routine at the
    beginning of my program.  I then do a SetArg and SetValue on the file
    selection widget, specifying DwtNfileToExternProc and the name of my
    VoidProc routine.  At this point in this routine I'm just typing
    "Hello" to the terminal.  The routine gets called once (displays okay)
    and then ACC VIO's.  It doesn't seem to know where to go once the
    routine executes.
    
    Two (2) questions:
    
    1. What am I doing wrong that's causing the ACC VIO?
    
    2. How is it possible to modify the string I want to appear in the
       file selection widget?  What data structures are used?
    
    Any pointers/suggestions appreciated!  Even a general conceptual
    description of how you're supposed to use these things would probably
    do the trick.
    
    Thanks in advance,
    
    - Chris Knorr
    
2845.4HPSCAD::PALMERFri Jul 27 1990 15:3010
    Hi,
    
    	Could someone post a little example of how to filter what goes into
    the list box?  I don't have access to the 5.3 documentation, thus have
    no documentation for this file_to_extern_proc...
    
    	Thanks,
    
    			Mark Palmer
    
2845.5One more thing...HPSCAD::PALMERMon Jul 30 1990 15:1114
    Another question...
    
    Is there any way to get access to the Filter, OK, and Cancel widget
    ids?
    
    What I want to do is put an SText widget in a file selection widget and
    do the same changing of the default button on the fly when focus is
    switched from the filter SText to mine.
    
    Is there a way to do this?...
    
    Thanks,
    
    		Mark