This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-09-16 04:44:29

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Question with C++

I know this might not be really advanced, but I really don't know how to make an event for when a button is pressed - since i'm making a login screen for a game i'm making - i need help for my OK button which logs the user in - but also I don't know what to do when the user presses Cancel - which should close the program.
oh btw - i'm using Microsoft Visual C++ and Forms - i found it the easiest way to make a window.
If no one knows what i mean - I mean, I want to make somthing happen when I press a button  tongue

Last edited by DigiTechs (2012-09-16 05:29:01)


I'm back.
Maybe.

Offline

 

#2 2012-09-16 07:53:46

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Question with C++

help please??? i cant work out how... D:


I'm back.
Maybe.

Offline

 

#3 2012-09-16 08:02:37

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: Question with C++

1. Go into the designer view.
2. Double-click the button.
3. Write your code.
4. Done!


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#4 2012-09-16 08:56:07

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Question with C++

meew0 wrote:

1. Go into the designer view.
2. Double-click the button.
3. Write your code.
4. Done!

when I do that, it only shows settings for the button... ugh.


I'm back.
Maybe.

Offline

 

#5 2012-09-16 09:00:24

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: Question with C++

DigiTechs wrote:

meew0 wrote:

1. Go into the designer view.
2. Double-click the button.
3. Write your code.
4. Done!

when I do that, it only shows settings for the button... ugh.

Which version of VC++ do you use?


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#6 2012-09-16 18:15:37

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Question with C++

DigiTechs wrote:

meew0 wrote:

1. Go into the designer view.
2. Double-click the button.
3. Write your code.
4. Done!

when I do that, it only shows settings for the button... ugh.

I get the same problem. Maybe you stick the code in where it brings you, i dont really know. i use C# instead of C++ for now, because i find its easier and i also grew up with it. My friend knows a lot about C++, maybe he can help. Ill ask him.


I am currently http://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=imagehttp://blocks.scratchr.org/API.php?user=GP1&action=onlineStatus&type=text and I finally got over 1000 posts.

Offline

 

#7 2012-10-06 13:14:49

iPhone63
Scratcher
Registered: 2010-12-15
Posts: 87

Re: Question with C++

I don't know if this will help, but from my knowledge of objective-c, you go into the 'designer view' as you call it, connect a "touch inside" action from the button to the "files owner", then select your action from the menu  smile

As I said, this might not work in C++, since I only know Objective-C!


http://mag.racked.eu/image/6000/Pssssssssssssssssss/mca.png

Offline

 

Board footer