Two newbie questions about wxWidgets (C++)

Started by
4 comments, last by crudbreeder 18 years, 2 months ago
1) How do you add text to a window? Like, in the top right corner of my parent window, I want it to say "Current Tile Selection: ".. 2) How do you add tables/borders to windows? Not like a grid, but like borders that you see used for different sections of a window. (EXAMPLE: http://img514.imageshack.us/img514/3452/box0ll.jpg ) [Edited by - DarkCybo1 on February 8, 2006 6:04:23 PM]
Hey babe.
Advertisement
Quote:Original post by DarkCybo1
1) How do you add text to a window? Like, in the top right corner of my parent window, I want it to say "Current Tile Selection: "..

I believe wxWindow::SetTitle will take care of that

Quote:
2) How do you add tables/borders to windows? Not like a grid, but like 3d-style borders that you see used for different sections of a window.

wxWindow derived classes have various border types

Maybe wxGrid is what your looking for?
Maybe just a wxGridSizer?

[edit]
oh, I just saw your not looking for a grid...so maybe you want a wxSplitterWindow or wxSashWindow to split the windows up

hth..
moe.ron
moe.ron
Quote:Original post by moeron
Quote:Original post by DarkCybo1
1) How do you add text to a window? Like, in the top right corner of my parent window, I want it to say "Current Tile Selection: "..

I believe wxWindow::SetTitle will take care of that


I dont mean setting the window caption, I mean just drawing text to the window itself.

Hey babe.
For the text you could use wxStaticText or a disabled wxTextCtrl with no border.
For the borders you can use wxStaticBox.

Hope that helps.
Thank ye. But do I have to create a new static text object for every piece of text I make? Or does one handle all the text appearing in a window?
Hey babe.
Yes. Every text string you want to display on the window (at the same time) needs it's own object.

If you just want to change the text of an object you use wxStaticText::SetLabel() or wxTextControl::SetValue() etc.


If you are developing bigger GUI apps, it might be a good idea to look into one of the available dialog editors

This topic is closed to new replies.

Advertisement