how to convert wxArrayString to wxString? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

how to convert wxArrayString to wxString?

Post by asitis » Fri Jul 24, 2009 6:04 am

This issue have been raised before but I still can't find solution. For example

wxArrayString strArr = new wxArrayString();
strArr.Add(_("Monday"));
strArr.Add(_("Tuesday"));

How do I convert strArr[0] to wxString so that I can dislplay it on a wxLabel?

Any help appreciated

User avatar
doublemax
Moderator
Moderator
Posts: 15260
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Fri Jul 24, 2009 6:29 am

wxArrayString behaves like an array of wxString.

So you can write:

Code: Select all

wxArrayString strArr;
strArr.Add(_("Monday"));
strArr.Add(_("Tuesday")); 

wxString s=strArr[0];
Use the source, Luke!

asitis
Earned a small fee
Earned a small fee
Posts: 21
Joined: Tue Jul 14, 2009 9:16 am

Post by asitis » Mon Jul 27, 2009 12:11 am

Thanks doublemax you've saved my life again. Thanks again for your patient for such stupid question of mine

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Mon Jul 27, 2009 12:18 am

If your question is solved, please accept his post to mark the topic as solved.
"Keyboard not detected. Press F1 to continue"
-- Windows

Post Reply