wxBook Projekt

This forum is reserved for everything you want to talk about. It could be about programming, opinions, open source programs, development in general, or just cool stuff to share!
Post Reply

Do you like the wxWidgets book?

Yes
13
93%
No
1
7%
 
Total votes: 14

AllektoSoftware
In need of some credit
In need of some credit
Posts: 6
Joined: Wed Jan 05, 2005 8:51 pm
Contact:

wxBook Projekt

Post by AllektoSoftware » Wed Aug 31, 2005 3:35 pm

Hi everyvody,

does anybody have experience with the new book about wxWidgets? I've just bought it recently and worked through the first 70 pages.

Looks pretty interesting and it seems to be a good help for a wxWidgets developer.

Somehow there are quite a few errors, like this one for example. This code within the book should demonstrate the wxNotebook:

Code: Select all

    wxNotebook *notebook = new wxNotebook(this, wxID_ANY,                          wxDefaultPosition, wxDefaultSize);
	
	wxImageList *imageList = new wxImageList(16,16,true, 3);
	imageList->Add(wxIcon(copy_xpm));
	imageList->Add(wxIcon(paste_xpm));
	imageList->Add(wxIcon(cut_xpm));
	
	wxPanel1 *window1 = new wxPanel(notebook, wxID_ANY);
	wxPanel2 *window2 = new wxPanel(notebook, wxID_ANY);
	wxPanel3 *window3 = new wxPanel(notebook, wxID_ANY);
	
	notebook->AddPage(window1, wxT("Tab One"), true,0);
	notebook->AddPage(window2, wxT("Tab two"), false,1);
	notebook->AddPage(window3, wxT("Tab three"), false,2);

First of all this code cannot be compiled because there are no wxPanel1 2 and 3. It should read like wxPanel *Panel1 ...

After correcting the code, the application compiles, but just crashes, because they try to give the tabs images, when there is no connection to an wxImageList defined.

This line is missing:

Code: Select all

	notebook->SetImageList(imageList);
That's pretty annoying, especially for newbies that i guess are wondering why the examples do not work.

I hope that there aren't many mistakes like this later on, in the more complicated examples. But anyhow i guess it's a must have for a wxWidgets developer.

Cheers,

Gunnar

KevinHock
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Sat Sep 04, 2004 1:49 pm
Location: Ohio, USA
Contact:

Post by KevinHock » Wed Aug 31, 2005 4:15 pm

This is definitely incorrect, thanks for spotting it, an apologies. We certainly would appreciate hearing any "bugs" in the book because they can be corrected for subsequent reprints, and we can also add a note to the book page under Errata.

The example in question is on page 73.

User avatar
Julian
Earned a small fee
Earned a small fee
Posts: 19
Joined: Wed Sep 29, 2004 8:07 am
Location: Edinburgh, UK
Contact:

Post by Julian » Wed Aug 31, 2005 5:02 pm

Yes indeed, apologies, and please point out any other problems so we can update the book in future reprints. I'll add corrections to the Errata section of the wxBook page at:

http://www.wxwidgets.org/book/

We did spend ages proof-reading but after a point it's hard to see the wood for the trees...

Thanks!

Julian
Try DialogBlocks for rapid dialog creation, and more:
http://www.anthemion.co.uk/dialogblocks

Chr
Earned some good credits
Earned some good credits
Posts: 115
Joined: Tue May 31, 2005 2:17 pm

Post by Chr » Wed Aug 31, 2005 6:07 pm

okay, there is another error (error? better: something which can be correct for reprints)
On page 63 and p.64 are shown two times the same pictures (the MDI-Demo, and NOT the wxMiniframe)
wxWidgets is nice

Post Reply