Hi all!
I'm developing an pplication with wxWidgets. I use sizers, wxStaticBoxSizer, and I add static texts inside it. The problem is I don't know hoe many lines I should add! When I receive a packet from the web I know how many lines should I add. Can I update the sizer's size to accomodate all the lines I need? How can I do it?
Ad advice: will this be a problem for the GUI? I mean, when the program receives the packet, it automaticcaly resize the main window, could this be a problem for the user?
Thank you
WxSizers and update Topic is solved
wxTextCtrl is a text area - just like the one you typed in when typing this reply. Making a non-editable text area can indeed be easier for just displaying a bunch of textcali1981 wrote:Which is the difference between them?
The advantage is that lines will automatically warp, whereas with staticText you would need to do it manually
-
- Super wx Problem Solver
- Posts: 264
- Joined: Mon Aug 07, 2006 3:25 pm
- Location: Baia Mare, Romania
- Contact:
The main diffrence is that you create a control for a text, adding alot of overhead for a simple task of displaying text data.
You coudl use wxListCtrl instead on wxTextXtrl/statictext. Whenever you get data you add a new list item.
Or if the data you receive is logically linked (eg a html source, chat messages, etc) you can use wxTextCtrl.
But of what I understand wxListCtrl with no column would fit you best. Just use a wxListCtrl in report mode, 1 single column, with labelEdit off, and set the column to autosize : Setcolumnwidth(col_num, -1);
Regards
You coudl use wxListCtrl instead on wxTextXtrl/statictext. Whenever you get data you add a new list item.
Or if the data you receive is logically linked (eg a html source, chat messages, etc) you can use wxTextCtrl.
But of what I understand wxListCtrl with no column would fit you best. Just use a wxListCtrl in report mode, 1 single column, with labelEdit off, and set the column to autosize : Setcolumnwidth(col_num, -1);
Regards
Software is like sex,
It's better when it's free.
~Linus Torvalds
It's better when it's free.
~Linus Torvalds
-
- Super wx Problem Solver
- Posts: 264
- Joined: Mon Aug 07, 2006 3:25 pm
- Location: Baia Mare, Romania
- Contact:
The main diffrence is that you create a control for a text, adding alot of overhead for a simple task of displaying text data.
You coudl use wxListCtrl instead on wxTextXtrl/statictext. Whenever you get data you add a new list item.
Or if the data you receive is logically linked (eg a html source, chat messages, etc) you can use wxTextCtrl.
But of what I understand wxListCtrl with no column would fit you best. Just use a wxListCtrl in report mode, 1 single column, with labelEdit off, and set the column to autosize : Setcolumnwidth(col_num, -1);
PS: if you stick to the statictext stuff, i suggets you use wxScrolledWindow as parent and call sizr->Layout() after adding something, or else ... the content will update on the next internal idle event or something (or so it they say) or when you resize the window.
Regards
You coudl use wxListCtrl instead on wxTextXtrl/statictext. Whenever you get data you add a new list item.
Or if the data you receive is logically linked (eg a html source, chat messages, etc) you can use wxTextCtrl.
But of what I understand wxListCtrl with no column would fit you best. Just use a wxListCtrl in report mode, 1 single column, with labelEdit off, and set the column to autosize : Setcolumnwidth(col_num, -1);
PS: if you stick to the statictext stuff, i suggets you use wxScrolledWindow as parent and call sizr->Layout() after adding something, or else ... the content will update on the next internal idle event or something (or so it they say) or when you resize the window.
Regards
Software is like sex,
It's better when it's free.
~Linus Torvalds
It's better when it's free.
~Linus Torvalds