Zetcode tutorial is bad

1,888 views
Skip to first unread message

E-man

unread,
Aug 16, 2010, 10:42:50 PM8/16/10
to wx-discuss
I don't think that we should have the Zetcode tutorial on the website.
When I didn't know a line of wxWidgets I went to the website and went
to tutorials. After I did the first one, I was hungry for more, so I
went to the "Intermediate wxWidgets tutorial" under "Getting Started".
After that I was disappointed because none of the code worked. For
every single example, I had to scrutinize it and correct the bugs,
which was very hard because I didn't know anything about wxWidgets in
the first place. I eventually gave up on "Menus and Toolbars" due to
the vast amounts of time that I was wasting. Although we all should
appreciate that Jan Bodnar took his time to write that tutorial, the
potholes are too many, and the difficulty for a noob to learn
skyrockets. So, can somebody please remove that link, or tell someone
that can, because I don't want another programmer to go through what I
went through.

Vadim Zeitlin

unread,
Aug 17, 2010, 5:26:48 AM8/17/10
to wx-di...@googlegroups.com
On Mon, 16 Aug 2010 19:42:50 -0700 (PDT) E-man <iamem...@gmail.com> wrote:

Em> I don't think that we should have the Zetcode tutorial on the website.

Is it really that bad or does it still have the good parts which would
justify keeping it and just inserting a warning saying that it's
incomplete?

Em> After that I was disappointed because none of the code worked. For
Em> every single example, I had to scrutinize it and correct the bugs,

I didn't try compiling it but at a glance the code at

http://zetcode.com/tutorials/wxwidgetstutorial/menustoolbars/

doesn't seem so wrong to me. What problems exactly did you have?

Thanks,
VZ

E-man

unread,
Aug 17, 2010, 3:48:52 PM8/17/10
to wx-discuss
It does have a lot of information. And it's not missing the
fundamental parts, but it's got a lot of potholes that don't look like
they're going to be fixed. It either has to be taken off, replaced, or
revised(probably better, but it hasn't been changed since Dec 2007).

My problem was the difference between this
wxBitmap exit(wxT("exit.png")); and this
wxBitmap exit(wxT("exit.png"), wxBITMAP_TYPE_PNG);

I spent what summed up to a day on that.

Vadim Zeitlin

unread,
Aug 17, 2010, 3:49:57 PM8/17/10
to wx-di...@googlegroups.com
On Tue, 17 Aug 2010 12:48:52 -0700 (PDT) E-man <iamem...@gmail.com> wrote:

Em> My problem was the difference between this
Em> wxBitmap exit(wxT("exit.png")); and this
Em> wxBitmap exit(wxT("exit.png"), wxBITMAP_TYPE_PNG);
Em>
Em> I spent what summed up to a day on that.

Err, there is nothing wrong with the first version. I don't know why
didn't it work for you but it certainly should.

Regards,
VZ

E-man

unread,
Aug 18, 2010, 1:01:49 AM8/18/10
to wx-discuss
Seriously? I spent like 12 hours on it though, and it worked with the
other one. Did you compile it?

Vadim Zeitlin

unread,
Aug 18, 2010, 7:13:14 AM8/18/10
to wx-di...@googlegroups.com
On Tue, 17 Aug 2010 22:01:49 -0700 (PDT) E-man <iamem...@gmail.com> wrote:

Em> Seriously? I spent like 12 hours on it though, and it worked with the
Em> other one. Did you compile it?

It definitely compiles. And normally it should also work (of course, the
other version should work too but the explicit image type is unnecessary).
If you have a problem with this, please describe it precisely, i.e. ideally
show how to reproduce it in the image sample by providing a patch (please
see http://trac.wxwidgets.org/wiki/HowToSubmitPatches) to it showing the
problem.

Regards,
VZ

evstevemd

unread,
Aug 19, 2010, 1:10:24 AM8/19/10
to wx-discuss, vron...@gmail.com
Sure it is not working!
But simple use of wxBitmap exit(wxT("exit.png"), wxBITMAP_TYPE_PNG)
instead of wxBitmap exit(wxT("exit.png")) and adding PNG handler that
is wxImage::AddHandler(new wxPNGHandler()) did it

I still see the tutorial as good one deserving a link, unless you
found other *critical* things that desrves attention.

Anyway I have CCed Jan so that he can see if he can do something on
that

evstevemd

unread,
Aug 19, 2010, 12:43:20 AM8/19/10
to wx-discuss
IMHO it deserves to be there.
Apart from wxBook there is no comprehensive tutorial than that one.
I have learned a lot from Jan, and I recommend it.
It got me started wxPython and It really helped me on wxWidgets C++.
All almost all codes in tutorials(I will test the menubar/toolbar
thing) worked for me.

I think your request will be better If you volunteer to write a good
replacement (rather a complement) in Wiki or somewhere else.
Steve

vronskij

unread,
Aug 19, 2010, 4:33:23 AM8/19/10
to wx-discuss
"none of the code worked"

This is just not true.

Today, I have compiled several examples
of my tutorial and all compiled and worked OK.
The simple toolbar example compiled as well. Here I must
say that I work on Linux. Newest Ubuntu release, wxWidgets version
2.8.10.1.
And I suppose that this toolbar example might not work on Window/Mac.

If somebody confirms that it does not work on Windows/Mac,
I can change that line.

Thanks evstevemd for informing me.

Jan Bodnar

evstevemd

unread,
Aug 19, 2010, 11:59:47 PM8/19/10
to wx-discuss
On Windows XP just apply thhe above Changes and it works fine!

Anders Larsen

unread,
Aug 20, 2010, 5:23:31 AM8/20/10
to wx-di...@googlegroups.com
Hello,

On 2010-08-19 10:33, vronskij wrote:
> The simple toolbar example compiled as well. Here I must
> say that I work on Linux. Newest Ubuntu release, wxWidgets version
> 2.8.10.1.
> And I suppose that this toolbar example might not work on Window/Mac.

On 2010-08-19 07:10, evstevemd wrote:
> Sure it is not working!
> But simple use of wxBitmap exit(wxT("exit.png"), wxBITMAP_TYPE_PNG)
> instead of wxBitmap exit(wxT("exit.png")) and adding PNG handler that
> is wxImage::AddHandler(new wxPNGHandler()) did it

my guess is that the second measure (adding a PNG handler) is the
important one, since the "a simple toolbar" toolbar tutorial doesn't
initialise any image handler at all.

(The second tutorial "toolbars" on the same page already does what
evstevemd suggested).

Cheers
Anders

E-man

unread,
Aug 20, 2010, 5:31:54 PM8/20/10
to wx-discuss
It turns out that I was compiling all the examples the wrong way.
Sorry.
Reply all
Reply to author
Forward
0 new messages