Help with WxDevcpp and programming

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
Alvarodt
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Jul 20, 2008 5:48 pm

Help with WxDevcpp and programming

Post by Alvarodt »

Hello, I'm sorry if I'm in the wrong sub-forum, I'm a spanish boy and I'm very lost on this forum

I've just downloaded WxDevcpp and I'm a bit lost, I've been programming for a year in C++ but using SDL and console so now I've found out this application and it looks very nice but my doubt is:

When I create a WxWidgets frame project and I put the buttoms in the window, I would like for example to store a number in a variable when you press a button.

For example I put a buttom in my project and I put the name "1" so I want when I press that buttom to store 1 in a int variable, but where do we have here a "int main" function to "make" our program? I hope you understand what I mean.

Thank you in advance.
Sof_T
Can't get richer than this
Can't get richer than this
Posts: 864
Joined: Thu Jul 28, 2005 9:48 pm
Location: New Forest, United Kingdom
Contact:

Post by Sof_T »

Hi

Can you show the code you are using, or post the project here, it will help us to help you ;-)

Sof.T
The home of Sof.T http://www.sof-t.site88.net/
Author of Programming with wxDevC++
http://sourceforge.net/projects/wxdevcpp-book/
Alvarodt
In need of some credit
In need of some credit
Posts: 2
Joined: Sun Jul 20, 2008 5:48 pm

Post by Alvarodt »

Hi, I've just created the project with the "assistant" I didn't write any code, but what the programa creat are 2 .cpp and 2 .h but I can't see a main function.

Here you have a screenshot

http://i34.tinypic.com/24ctjwh.jpg
Sof_T
Can't get richer than this
Can't get richer than this
Posts: 864
Joined: Thu Jul 28, 2005 9:48 pm
Location: New Forest, United Kingdom
Contact:

Post by Sof_T »

Unlike ordinary C++ programming there is no main function. The program is event driven not sequential. I found it difficult to understand when I first started to program like this.

The program starts in the ...App.C file in the function called Init.

When the program starts it sits there waiting for somethin to happen this is called an event. The event could be someone clicking on a button, or it ould be a timer event or a key press, etc.

You need to write sections of code that respond to the events. You can find the events on the event tab in the property inspector.

Sof.T
The home of Sof.T http://www.sof-t.site88.net/
Author of Programming with wxDevC++
http://sourceforge.net/projects/wxdevcpp-book/
Post Reply