I'm handling the EVT_INIT_DIALOG event to know about the the initialisation of the panel as mentionned in the documentation :
A wxInitDialogEvent is sent as a dialog or panel is being initialised.
InitDialog() is not called by wxPanel ! Topic is solved
The event table in the cpp file :
in .h file :
I'm called is never shown !!!
Code: Select all
BEGIN_EVENT_TABLE(ClientListPanel,wxPanel)
EVT_INIT_DIALOG(ClientListPanel::OnInitDialog)
END_EVENT_TABLE()
// ...
// the InitDialog handler
void ClientListPanel::OnInitDialog(wxInitDialogEvent& event)
{
printf("I'm called...");
}
Code: Select all
class ClientListPanel : public wxPanel
{
// ...
protected:
void OnInitDialog(wxInitDialogEvent& event);
//...
private:
DECLARE_EVENT_TABLE()
};
Just for kicks, can you use PRINTF at all in a GUI based environment? AFAIK printf goes nowhere in a GUI. I am not sure about Linux, but I definately know it is not going anywhere in Windows.
Either use a debugger and see if something is called, or try to use wxLogMessage / wxLogError to simulate a log action and it will be routed to either a dialog or console if possible.
But I am sure printf is not your answer.
- Jorgen
Either use a debugger and see if something is called, or try to use wxLogMessage / wxLogError to simulate a log action and it will be routed to either a dialog or console if possible.
But I am sure printf is not your answer.
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
I'm using Code::Blocks IDE and the output it shows the output on a separate window when in the debug mode. Also I'm linking without the -mwindows option.Jorg wrote:Just for kicks, can you use PRINTF at all in a GUI based environment? AFAIK printf goes nowhere in a GUI. I am not sure about Linux, but I definately know it is not going anywhere in Windows.
Either use a debugger and see if something is called, or try to use wxLogMessage / wxLogError to simulate a log action and it will be routed to either a dialog or console if possible.
But I am sure printf is not your answer.
- Jorgen
-
- Knows some wx things
- Posts: 36
- Joined: Mon Jan 01, 2007 10:55 am
-
- Knows some wx things
- Posts: 36
- Joined: Mon Jan 01, 2007 10:55 am
Manianis, I just called InitDialog() in the constructor of the class derived from wxPanel and it works.
My OnInitDialog is called first. But there is called OnPaint() before OnSize(). I don't know if this should be this way, because in OnSize I want to create a backbuffer and I will have to do it in OnInitDialog(), but wxInitDialogEvent does not have a GetSize() function. Anyway this does not concert to this post.
See you.
My OnInitDialog is called first. But there is called OnPaint() before OnSize(). I don't know if this should be this way, because in OnSize I want to create a backbuffer and I will have to do it in OnInitDialog(), but wxInitDialogEvent does not have a GetSize() function. Anyway this does not concert to this post.
See you.
Yakumo, searching Pai.