Search code examples
c++wxwidgets

Use wxWidget to create a rectangle area with relief


I have recently begun to use wxWidget, it is a very powerfull GUI API and from now I want to create some rectangles with relief flags like: "flat", "raised", "sunken" and so on but I don't see any things in the website guide at http://docs.wxwidgets.org/trunk/classes.html#letter_T which I can use to realise this customize widwget. Somebody can help me??


Solution

  • There are two kinds of windows, toplevel windows that appear by themselves, and child windows that appear inside, or at least 'belong' to another window. Every window except a toplevel windows should have a parent.

    The window you have created does not have a parent and is not a toplevel window. You should first create a wxFrame, which is a toplevel window, before you create any other windows.

    You should take a look at the sample applications, in particular the one called 'mimimal' which shows how to code an application that behaves nicely. Once you understand how that works, you can modify the sample code to do what you want.