Strange gtkd behaviour

Mike Wey mike-wey at example.com
Thu Jul 14 14:13:24 PDT 2011


On 07/14/2011 07:53 AM, maarten van damme wrote:
> when I leave destroy out the inputbox always stays visible even after
> I've pressed ok.
> here are the other files
> http://dl.dropbox.com/u/15024434/Main.d
> http://dl.dropbox.com/u/15024434/InputBox.d
> http://dl.dropbox.com/u/15024434/MessageBox.d

I see you are calling Main.run twice, although you would only call it 
once it will work. But you'll also need to call Main.Quit twice, 
probably when the second 'Messagebox' is closed.

This is because Main.run() runs the gtk eventloop and returns when 
Main.Quit is called.

Yoe might also want to look at gtk.Dialog and gtk.MessageDialog for your 
"InputBox" and "MessageBox" respectively.
gtk.Dialog has it's own run method which returns a response code when 
the user closes the dialog, by clicking ok/cancel/etc... or just closes it.

-- 
Mike Wey


More information about the Digitalmars-d mailing list