![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#2 |
|
The Oblivious One
Join Date: May 2005
Location: Ontario, Canada
Posts: 641
Rep Power: 4
![]() |
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! |
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
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 |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: May 2005
Location: ma
Posts: 130
Rep Power: 4
![]() |
Sorry i was using QT Designer on Linux.
|
|
|
|
|
|
#5 |
|
Expert Programmer
|
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.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|