Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: killerbot on February 08, 2006, 09:28:49 pm

Title: wxWidets app : just dialog
Post by: killerbot on February 08, 2006, 09:28:49 pm
Can any experienced wx programmer tell me how to do the following :

- just a simple based dialog app (so no sdi/mdi/frame).
- what do I need to do with the xrc from (wxSmith) for this

I tried to adjust the wx project generated by CB from the wx template. Replacing the frame with a dialog, but I don't seem to be able to load the xrc.

Thanks for the info,
Lieven
Title: Re: wxWidets app : just dialog
Post by: byo on February 10, 2006, 08:53:51 am
At the beginning I must warn that I had some problems with wxApps working with dialogs only. After closing dialog, the application still remains in memory. But I hope there's easy solution for that.

Ok, steps to create dialog-only application using wxSmith's wizard:


It worked for me, I've used 7 feb nightly build

And one suggestion - maybe it would be better to use wxFrame class and put panel into it and all components into that panel. This should behave alsomst exackly like dialog.
Title: Re: wxWidets app : just dialog
Post by: mandrav on February 10, 2006, 09:04:04 am
Quote
At the beginning I must warn that I had some problems with wxApps working with dialogs only. After closing dialog, the application still remains in memory. But I hope there's easy solution for that.

That's easy.

In App::OnInit() where you create the dialog, don't just Show() it but use ShowModal(). And after this, return false from OnInit().