WxSmith tutorial Hello world

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
markjuggles
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Feb 10, 2013 11:22 pm

WxSmith tutorial Hello world

Post by markjuggles »

Hello,

I am new to wxWidgets but have used Motif in the ancient past and C# .NET more recently.

After installing the latest Code::Blocks (12.11) and the latest wxWidgets (2.8.12), I began following the tutorial at:

http://wiki.codeblocks.org/index.php?ti ... ello_world

Basically, the process was to:

Add wxBoxSizer
Add wxPanel
Add wxBoxSizer
Add wxStaticText
Add wxButton

Compiling and running immediately after the adding the wxPanel is successful.

Compiling and running anytime after adding the 2nd wxBoxSizer results in a SIGSEGV on the 1st line of wxSizer::GetMinSize(). (See my comment below.)

wxSize wxSizer::GetMinSize()
{
wxSize ret( CalcMin() ); // SIGSEGV
if (ret.x < m_minSize.x) ret.x = m_minSize.x;
if (ret.y < m_minSize.y) ret.y = m_minSize.y;
return ret;
}

The tutorial did not have a screen shot of the Resource window for the final steps. My understanding is that the 2nd wxSizer is "under" the wxPanel and both the wxStaticText and the wxButton are "under" the 2nd wxSizer.

What have I done wrong?

Thank you,

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

Re: WxSmith tutorial Hello world

Post by doublemax »

My understanding is that the 2nd wxSizer is "under" the wxPanel and both the wxStaticText and the wxButton are "under" the 2nd wxSizer.
If with "under" you mean "inside", this sounds ok.

But even if the structure you created was wrong, it shouldn't crash. So i'm not sure what went wrong.

It should look like this:
Attachments
wxsmith_screen.gif
wxsmith_screen.gif (6.77 KiB) Viewed 2481 times
Use the source, Luke!
markjuggles
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Feb 10, 2013 11:22 pm

Re: WxSmith tutorial Hello world

Post by markjuggles »

Yes, my resources window has exactly that organization.

I should add that my OS is Windows 7, 32-bit.

Are there ready-make projects available that can be downloaded and compiled as a test or alternative tutorials?
User avatar
doublemax
Moderator
Moderator
Posts: 19032
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: WxSmith tutorial Hello world

Post by doublemax »

I don't use C:B or wxSmith, so i can't help much.

I'd try rebuilding the libraries and start with a fresh new project.
Use the source, Luke!
zeeTop
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Dec 10, 2012 3:30 am

Re: WxSmith tutorial Hello world

Post by zeeTop »

Hi Mark,

I use codeblocks/wxwidgets on windows 7 without an issue.

Im not a fan of wxSmith (personal taste) and use wxFormBuilder.

I have created a small sample with wxSmith that runs without any errors using doublemax's layout he posted.

See how that goes for you.
Attachments
test.zip
(231.26 KiB) Downloaded 88 times
User avatar
doublemax
Moderator
Moderator
Posts: 19032
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: WxSmith tutorial Hello world

Post by doublemax »

Thanks zeeTop.
Use the source, Luke!
markjuggles
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Feb 10, 2013 11:22 pm

Re: WxSmith tutorial Hello world

Post by markjuggles »

Success!

The options for downloading wxWidgets are shown below:

Latest Development Release: 2.9.4
Current Stable Release: 2.8.12
Previous Stable Release: 2.6.4

I had chosen the "Current Stable Release" but that was a mistake. Trying again with the "Latest Development Release" resulted in something that will compile and run.

Thank you all for your responses.

Mark
Post Reply