You would use...
(Boolean) Save Button to trigger a CASE
The CASE contains File Dialog (to prompt user to enter new filename or select an existing file etc.)
If user OK the File Dialog with valid filename, save your data with appropriate File I/O function(s). Else, if user cancel the File Dialog, prompt warning message to warn of i.e."data not saved" or simply do nothing etc.
You should able to code it 😉