import { showMessageBoxEx, closeMessageBox } from '../shower.js';

const handle = showMessageBoxEx({
    message: 'Testing closeMessageBox(pid) - will close in 2 seconds',
    buttons: ['OK']
});

console.log('Dialog PID:', handle.pid);

setTimeout(() => {
    console.log('Closing via closeMessageBox(' + handle.pid + ')...');
    const success = closeMessageBox(handle.pid);
    console.log('Close success:', success);
}, 2000);

handle.result.then(result => {
    console.log('Result:', JSON.stringify(result));
}).catch(err => {
    console.log('Error:', err.message);
});
