Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 30th, 2007, 9:26 AM   #1
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
wxWidgets and memory

hey!

i was just wondering about wxWidgets, i've started reading tuts etc and ive noticed that most of the apps included leak memory...

i was wondering if theres any steps to go through to avoid memory leaks...

thanks!

oh, is there a way i can explicitly code the main function rather than use the IMPLEMENT_APP macro, ive though about looking at the macro decls, but it sounds like a pain!
rwm is offline   Reply With Quote
Old Aug 30th, 2007, 9:37 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You can explicitly code everything that wxWidgets does for you. Most people use it to avoid doing that.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 30th, 2007, 9:43 AM   #3
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
Thanks DaWei!

Ah well thats cool... i've always hated macro stuff!

Well, with regard to the memory leaks, I guess what I could do is store pointers to all wx elements I allocate on the heap, and delete those myself...

But im not sure what wxWidgets does with its objects - whether it frees the heap objects when destroyed, or whether i must do it by hand...

Still looking through the docs...

I actually like the library, much simpler than windows API... But GUI programming overall, not a fan!
rwm is offline   Reply With Quote
Old Aug 30th, 2007, 9:46 AM   #4
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
Oh, forgot, you can download the book "Cross-platform programming with wxWidgets" for free....

http://www.phptr.com/content/images/...73816_book.pdf

neato!
rwm is offline   Reply With Quote
Old Aug 30th, 2007, 10:00 AM   #5
mrynit
Hobbyist Programmer
 
mrynit's Avatar
 
Join Date: Mar 2006
Location: WA, USA
Posts: 332
Rep Power: 3 mrynit is on a distinguished road
Send a message via AIM to mrynit Send a message via MSN to mrynit Send a message via Yahoo to mrynit Send a message via Skype™ to mrynit
Quote:
Originally Posted by rwm View Post
I actually like the library, much simpler than windows API... But GUI programming overall, not a fan!
have you tried making gui's in java? it is cross platform and fairly easy to use. thanks for the pdf
__________________
i dont know much about programming but i try to help
mrynit is offline   Reply With Quote
Old Aug 30th, 2007, 10:15 AM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Yeah, but buying an entire application, GUI and all, means you don't have to do ANY programming in ANY language. Can't beat that for easy.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 30th, 2007, 10:16 AM   #7
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
hey man!

ive actually started learning java for htat exact reason... the cross-platform is the best thing about java i feel... maybe a little slower, but much faster to write apps...

java is a nice language!

still need to get more familiar with the syntax....
rwm is offline   Reply With Quote
Old Aug 30th, 2007, 10:18 AM   #8
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
Quote:
Yeah, but buying an entire application, GUI and all, means you don't have to do ANY programming in ANY language. Can't beat that for easy.
hey, didnt see your post... sorry, what you mean?
rwm is offline   Reply With Quote
Old Aug 30th, 2007, 1:09 PM   #9
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Well, you ask a question in the C++ forum, a guy recommends Java. I just thought it would be as helpful to you for me to recommend doing nothing at all.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 30th, 2007, 2:44 PM   #10
rwm
Professional Programmer
 
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 2 rwm is on a distinguished road
Ah well maybe that's just the "fanboy" in him

rwm is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:50 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC