News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

wxFlatNotebook update + Patch

Started by MortenMacFly, May 05, 2006, 08:31:21 AM

Previous topic - Next topic

MortenMacFly

Dear devs,
since I'm using wxFlatNotebook in a project myself I realised that C::B uses a rather old version (0.90) of the library. I've updated my C::B to the current version (1.30) for quite some time now and I've also adopted the patch for C::B to the new version which I provide with this message.
So basically I'd like to say: On my machine wxFlatNotebook v1.30 works very well, the required patch is attached.
With regards, Morten.
Edit: Removed patch to save forum space. It has been applied already.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

thomas

Could you provide another patch please? :)

I tried applying this one with TortoiseMerge, which did not work.
Then I tried gnu patch, and all I got was:
patch: **** Only garbage was found in the patch input.
Editing patchfiles by hand is nasty business, especially when there are several files with several chunks each.

Just cd to the wxFlatNotebook folder and type svn diff > patchname.patch, that works out fine (or even easier, right-click onto the folder if you have Tortoise installed, and select "create patch").
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

MortenMacFly

#2
Quote from: thomas on May 05, 2006, 09:36:58 AM
Could you provide another patch please? :)
Well, I guess I didn't made myself clear enough. The patch is not to be applied to the sources of C::B. This patch has to be applied to the sources of wxFlatNotebook, version 1.30. So to update C::B you would have to do the following:
1.) Download wxFlatNotebook v1.30
2.) Copy the sources into C::B overwriting the onces there (which are v0.90)
3.) Apply my patch to these sources.
Why did I do this? Because that's the way how the patch for v0.90 is provided in C::B SVN.
If I provide a file to patch the sources fom C::B SVN (v0.90) directly to v1.30_patched that this would be a huge file and noone could understand what changes actually were made to the original v1.30 version.
With regards, Morten.

Edit: Of course I could do that, too... give me some time... ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

MortenMacFly

#3
...here it comes: This patch should update the current SVN head to wxFlatNotebook v1.30_patched. This will also update the patch file so that in the end C::B is updated to v1.30, patched and the C::B patch from SVN is updated accordingly. This also updates the readme files in wxFlatNoteBook.
With regards, Morten.
Edit: Removed patch to save forum space. It has been applied already.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

thomas

Applies cleanly, and works fine under Windows, thanks.

Let's see what the Don finds out under Linux :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

tiger683

#5
It fixed a nasty bug for me, when accidentally dragging a notebook-panel or a marked text itself inside the notebook area
would freeze the mouse pointer on button-release (could move it, but rendering it unable to click anything, even outside C::B window) :D
Thanks!

EDIT: It's gentoo Linux unicode build, wxGTK 2.6.3_p2, C::B revision 2411, gcc-4.1/glibc-2.4
Where I work :P

thomas

Update: It does not work so nicely after all.  :(
When closing the application without having a project open, I get a null pointer exception...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

thomas

The reason for this is that EditorManager destroys its notebook page on exit. wxFNB 1.3 destroys the notebook page again, which causes the crash.

The modification for EditorManager is in svn.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

tiger683

Quote from: thomas on May 05, 2006, 01:22:01 PM
The modification for EditorManager is in svn.

Thanks!  :D

Didn't notice since the "Something went wrong inside C::B" window disappeared so fast
Where I work :P

MortenMacFly

Quote from: thomas on May 05, 2006, 01:04:37 PM
When closing the application without having a project open, I get a null pointer exception...
I obvoisly never did that... which is surpising me... :shock: - but I can confirm this issue. It also happens when you just close the start page after a fresh startup of C::B.
Quote from: thomas on May 05, 2006, 01:22:01 PM
The modification for EditorManager is in svn.
Luckily I can confirm this, too. Thanks, Thomas!
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

killerbot

editormanager adjust is in svn, should wxFNB also not be updated then in svn ?
We might have a leak without the destroy and the old wxFNB ?

mandrav

Quote from: killerbot on May 05, 2006, 03:23:36 PM
editormanager adjust is in svn, should wxFNB also not be updated then in svn ?

Not until I test it under Linux...

Quote from: killerbot on May 05, 2006, 03:23:36 PM
We might have a leak without the destroy and the old wxFNB ?

We can live with it for a few hours, I guess ;)
Be patient!
This bug will be fixed soon...

sethjackson

Umm wouldn't this be more appropriate in the EditorManager destructor?

Code (cpp) Select

if (m_pNotebook)
    m_pNotebook->Destroy();


Please pardon my ignorance if this is bad code......  :lol:

Der Meister

If I understand thomas correctly this would not solve the problem because the editormagager would destroy the notebook as the pointer is valid (and it should be valid as the old line didn't crash) and *after that* wxFND would try to destroy this notebook again and this will crash - no matter if you check the m_pNotebook pointer in editormanager or not.
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

yop

Also it's totaly legal to "delete" a null pointer. All the problems arise from the fact that including myself many forget to set the pointer to null after deletion.
From: http://www.cplusplus.com/doc/tutorial/dynamic.html
QuoteThe value passed as argument to delete must be either a pointer to a memory block previously allocated with new, or a null pointer (in the case of a null pointer, delete produces no effect).
Life would be so much easier if we could just look at the source code.