Strange gtkd behaviour

Mike Wey mike-wey at example.com
Wed Jul 13 14:44:57 PDT 2011


On 07/13/2011 11:00 PM, maarten van damme wrote:
> Hello everyone,
> I wrote two classes that inherit from the Mainwindow class, one is a
> dialog that asks for your input and one is a plain old messagebox.
> you can check out the input class here, I think thats the one with the
> problem: http://dl.dropbox.com/u/15024434/InputBox.d
> or read the method most likely containing the error:
> void onclicked(Button button){
> *answer=input.getText();
> destroy();
> Main.quit();
> }
>
> Then I have a main class where I create an inputbox and do Main.run(),
> then when the user closes the window or presses ok everything after the
> first main.run gets runned and that displays a messagebox that depends
> on what the user entered followed by another Main.run();
>
> The problem is that when you press ok to close the first input window
> and then close the next messagebox the program keeps running in memory.
> Everything after the second Main.run never gets executed. When you
> however close the first window using the close button and then close the
> next messagebox the program terminates correctly.
> I'm assuming I don't completely destroy the inputbox in the onclicked
> method?
>
> If what I gave you is not enough I can give you the links to all the
> files. Note that these classes are simply me learning gtkd and the d
> language in general. If you see me doing something "dirty" or bad please
> tell me so I learn a bit from my mistakes :)
>
> Maarten

I'm not sure if the Main.Quit gets executed after you've destroyed the 
InputBox, does it work correctly without the call to destroy?

If not links to the other files would be helpfull.

-- 
Mike Wey


More information about the Digitalmars-d mailing list