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

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

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

setTimeout(() => {
    console.log('Closing dialog programmatically...');
    const closed = handle.close();
    console.log('Close result:', closed);
}, 2000);

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