Question about wxDirPickerCtrl and wxDirDialog Topic is solved
Question about wxDirPickerCtrl and wxDirDialog
My application need to open a dir. I tried wxDirDialog first. I passed wxDD_CHANGE_DIR in the constructor to it. But it doesn't work. The last opened dir can never be saved. So I changed to use wxDirPickerCtrl. It did work when I passed wxDIRP_CHANGE_DIR. The problem is I want to change the label from "Browse" to some other meaningful word in my application. It doesn't work if I use SetLabel function after the wxDirPickerCtrl object is created. Can anybody advise? Thanks.
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
O! you mean this:
Code: Select all
m_dirPickerSrc->GetWindowChildren()[1]->SetLabel(wxT("Priyank"));
I didn't try this. I tried this one because I though wxDirPicker itself is a control which can has a label.priyank_bolia wrote:O! you mean this:Code: Select all
m_dirPickerSrc->GetWindowChildren()[1]->SetLabel(wxT("Priyank"));
Code: Select all
m_dirPickerSrc->SetLabel(wxT("Priyank"));
It works if I changed the array index from 1 to 0.priyank_bolia wrote:O! you mean this:Code: Select all
m_dirPickerSrc->GetWindowChildren()[1]->SetLabel(wxT("Priyank"));
Thank you so much.
-
- wxWorld Domination!
- Posts: 1339
- Joined: Wed Aug 03, 2005 8:10 am
- Location: BANGALORE, INDIA
- Contact:
Which platform you are using, also to mention that this is not a portable way, but this is the only way. You can also iterate through the list and can check whether its a button, and then set the Label, too tiresome.zhouhao wrote:It works if I changed the array index from 1 to 0.priyank_bolia wrote:O! you mean this:Code: Select all
m_dirPickerSrc->GetWindowChildren()[1]->SetLabel(wxT("Priyank"));
Thank you so much.