cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Default file name in file_selector() dialog box

Highlighted
Newbie

Default file name in file_selector() dialog box

Hello Adepters,

I'm using the file_selector() function to create a "Save As" dialog:

file_selector(".", "doc", "Word Documents|*.doc", "Save Word Document
As", 0x02+0x04)

Is there any way to specify a default value for the "File Name" field in
the resulting dialog box? I'm using ACL at the moment, but I'm also
okay with using the AOM.

Thanks,

-James



Tags (2)
3 REPLIES 3
Highlighted

Default file name in file_selector() dialog box

Hey, James...

The file_selector() function does most, but not quite all, of what's
possible by directly calling the Win32 function for an Open/Save
dialog. That's part of what would make me hesitate to switch to doing
the Win32 call, since it would involve a bunch more work just to
accomplish the same thing as you're doing right now with just a single
line of code. However, so far as I can tell, that's probably what it
would take to accomplish this, other than doing something like a
custom XUI, which would also be a fair bit of work, but possibly of a
more comfortable sort, depending upon your tastes.

If you're interested in the Win32 route, the function you'll want to
look at is called GetSaveFileName. It requires reading and writing a
structure, which you can do with the unpack() and pack() functions,
respectively.

-Brandon 🙂

Highlighted

Default file name in file_selector() dialog box

Thanks, Brandon. That sounds like a lot of work. I'm going to attempt the (possibly) simpler solution of getting our users to agree with me that they don't actually need it. 🙂

-James

Highlighted

Default file name in file_selector() dialog box

My favorite solution!

Announcements