Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Jan 15th, 2006, 3:29 PM   #1
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
Writing code intended for a GUI Developing program

hi. i've just been messing around with a few simple programs today to refresh my memory on C++. I decided to write a simple one and try to use a GUI development program to see if i can make a gui for it. now when you use the GUI developer to attach code to the widgets can you only attach a function for it to execute? Here is the simple program i was tryiing to make a GUI for.

#include <iostream>

using namespace std;

 int main()
{
	int NUM;
	
	cout << "Input a number: ";
	cin >> NUM;
	cout << "You entered " << NUM << "\n";
}

now because i know the input a number would be a input box would i have the first cout and cin in a function say input() and then have the widget use that function for the input box? Or is that an unecessary step? Thanks for any replies in advance.
linuxpimp20 is offline   Reply With Quote
Old Jan 15th, 2006, 3:44 PM   #2
Jessehk
The Oblivious One
 
Jessehk's Avatar
 
Join Date: May 2005
Location: Ontario, Canada
Posts: 641
Rep Power: 4 Jessehk is on a distinguished road
I don't think I could help you, but it would probably help other potential helpers if you specified which GUI toolkit you were trying to use.

Windows Forms? Qt? Gtkmm?
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS!
Jessehk is offline   Reply With Quote
Old Jan 15th, 2006, 7:20 PM   #3
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Win API?
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Jan 15th, 2006, 10:02 PM   #4
linuxpimp20
Hobbyist Programmer
 
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4 linuxpimp20 is on a distinguished road
Sorry i was using QT Designer on Linux.
linuxpimp20 is offline   Reply With Quote
Old Jan 16th, 2006, 1:18 AM   #5
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 4 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
Look at the problem on at hand.

Your not going to be using cout and cin. So you need another way to input and output the data.

How about a label saying "Input your number: " and then a lineEdit and a pushbutton, and when it is pushed it pops up a message box saying "You enter <contents of lineEdit>".
__________________
Join us at #programmingforums @ irc.freenode.net!

My software never has bugs. It just develops random features.
coldDeath 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:47 AM.

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