germax Messages: 20 Registered: March 2017 Location: germany
Promising Member
And another brick wall I need to chew myself through
I have a FileDialog (defined in .lay) that I now want to add a 'convenience' button to
that opens the FileSelector and then copies the path over to my input box.
Again, for a more experienced man than I am, that shouldn't be much of an issue, right?
I'm still stuck somehow.. here are some lines of nastyness
....
NewFLdlg dlg;
/*
dlg is my file dialog and apart from some bits and bolts
it has a button ofs (open file selector)
and an editstring path (to take ... you guessed it ... my file path)
*/
String fsp = "nixx"; // just a String I added to test if the lambda can read 'outside'
dlg.button.WhenPush = [=]
{
FileSelector fs;
fs.AllFilesType().Multi(true);
if(fs.ExecuteOpen("Dummy Demo"))
PromptOK("\1"+~fs);
else
PrompOK(fsp); // works so far...
/* BUT
fsp = ~fs; // is not working since fsp is now a const
//error: passing 'const Upp::String' as 'this' argument discards qualifiers [-fpermissive]
PromptOK(AsString(~dlg.path)); // error: use of deleted function 'NewFLdlg::NewFLdlg(NewFLdlg&)'
Not even mentioning
dlg.path = ~fs; // what I'm really after
*/
};
.....
I'd like to avoid to add a callback (well a non lambda callback that is )
if at all possible.