Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
What is the best way to program non-console based programs in C++? Is there an easy way like TI-BASIC's Pxl-On( function, or do I need to learn something like OpenGL? Also, is there a better language than C++ for programming a graphical program?
I prefer Java or Python.

What sort of GUI? games or buttons/menus?

and OpenGL is for 3d stuff.
GUI programming is nothing like on a calc where its menu commands and loops (at least, none that you see). OpenGL is only needed for 3d stuff (like games). Using a GUI API means you never actually DRAW anything, instead you just create buttons and text boxes somewhat like in HTML (in that you just make a button, and not actually draw it)

C++ is perfectly fine for begginer GUI program IF AND ONLY IF (or so i've found) the GUI toolkit API you are using is DESIGNED with C++ in mind (or OOP in general) - stay away from 'ports' like GTK+, which can be very confusing as it doesn't follow the OOP design

My favorite GUI API is wxWidgets, available here: www.wxwidgets.com

However, C++ GUI's can be complex due to compiling/linking issues. I'd suggest learning and programming in Python, as then you don't have to deal with any of that crap. Get python here: www.python.org (they also have a great tutorial there - i suggest reading it) and the python port of wxWidgets is available here: www.wxpython.org

Once you've got the basics down, then you will begin to use a RAD to actually MAKE the GUI as it is much, much faster. I use wxGlade for Python/wxPython code, or DialogBlocks for C++/wxWidgets code
First off, I just want to start with buttons and menus and stuff, but eventually I'm going to try to get into 2d games.

I'm checking out wxWidgets now. I'll wait until I get confused and start crying before I try to teach myself Python.

Thanks, guys. I saw an OpenGL tutorial and almost passed out. I'm glad there's a better way. Very Happy
Java is really nice for GUI design as Swing/AWT are incredibly powerful and allow you to even design your own GUI elements.

wxGlade has a nasty habit of crashing so I use Boa Constructor when Im doing GUI design in python.

finally, if you do start with python, pygame is a good package for making games.
elfprince13 wrote:
Java is really nice for GUI design as Swing/AWT are incredibly powerful and allow you to even design your own GUI elements.

wxGlade has a nasty habit of crashing so I use Boa Constructor when Im doing GUI design in python.

finally, if you do start with python, pygame is a good package for making games.


java sucks, i'd avoid it like the plague Razz

boa constructor is available here: http://boa-constructor.sourceforge.net/

Foamy, Python is extremely easy to learn and use, much easier than C++ (yes still powerful and fast enough that I'm using it more than C++...) The interactive sessions are a godsend for playing around/learning, and its syntax is amazingly friendly (you'll never do stupid stuff like forget a ';' at the end of a statement - because it doesn't have any Very Happy ) - i strongly encourage you to try it out, because it is much easier to learn at a higher level then work your way back down Wink
Gah... I know too many languages already and I suck at them all...

I'm at least desent at QBASIC, and I can do some stuff in C++ and JavaScript. Oh well, what's one more.

Thanks, guys.

Oh, and by the way, what's the best (easiest to use/quickest download) Python Compiler?
I'd be interested in knowing that too...
foamy3 wrote:
Oh, and by the way, what's the best (easiest to use/quickest download) Python Compiler?


The "official" Python - aka CPython, availble here: http://www.python.org/download/

You want THIS specific version tho (2.4.3 win32 installer): http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi

Oh, and its not really called a "compiler" per se, its an interperator (python isn't compiled - just like TI-Basic isn't compiled)
Kllrnohj wrote:
foamy3 wrote:
Oh, and by the way, what's the best (easiest to use/quickest download) Python Compiler?


The "official" Python - aka CPython, availble here: http://www.python.org/download/

You want THIS specific version tho (2.4.3 win32 installer): http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi

Oh, and its not really called a "compiler" per se, its an interperator (python isn't compiled - just like TI-Basic isn't compiled)


Can interpreters still make exes, or does everyone that wants to run the program need to have an interpreter?

EDIT: And what is a .msi file? Is it just like an executable?
foamy3 wrote:
Kllrnohj wrote:
foamy3 wrote:
Oh, and by the way, what's the best (easiest to use/quickest download) Python Compiler?


The "official" Python - aka CPython, availble here: http://www.python.org/download/

You want THIS specific version tho (2.4.3 win32 installer): http://www.python.org/ftp/python/2.4.3/python-2.4.3.msi

Oh, and its not really called a "compiler" per se, its an interperator (python isn't compiled - just like TI-Basic isn't compiled)


Can interpreters still make exes, or does everyone that wants to run the program need to have an interpreter?

EDIT: And what is a .msi file? Is it just like an executable?


Python, by itself, cannot create a .exe, but using py2exe you can make a win32 executable (the python script that you code is cross-platform, hence the reason it doesn't compile)

an .msi file is a microsoft installer file - it needs .NET framework 1.1 if i remember correctly (it is an executable tho, just doulbe click it Wink )
I hate dial-up...

Anyway, I finally got Python downloaded!

I hate the setup of it, but I'm sure it will grow on me later.

The only problem I'm seeing right off of the bat is loading source files. Is there a way I can just type Python code into notepad, then open it in Python later to run it? I do a lot of my programming away from my home comp.



I typed

Code:
>>> print "Pwned!"

into notepad and saved it as pwned.py

In IDLE(Python GUI) I opened the file fine, but can't get it to run...
Try this out:

Save this file as hello.py

Code:
print "Hello, World!"
raw_input("Press enter to quit.")


Then simply double click hello.py and it (should) pop up a command prompt window with the text "Hello, World!" followed by "Press enter to quit." - simply hit enter to quit Wink

Notes: The raw_input, if you haven't gotten that far in the tut yet, is merely being used here to pause the execution so that the window doesn't just pop up then close right away.

IDLE isn't how you run python files, it is instead how you edit them. Its just a text editor (although with syntax highlighting, auto-indenting, etc..)
Ohhhh, okay. Now it's working. Thanks!
Cool! I'm definitely going to have to try this myself.
foamy3 wrote:
Ohhhh, okay. Now it's working. Thanks!


Also try out the interactive python session (go to start->programs->python->Python (command line))

that allows you to type python code and have it be run right away (thats why you saw those ">>> " before, that is the input line that the interactive session uses)
Cool! So it runs a command every time you type one and hit enter? And remembers things like variable values etc?
KermMartian wrote:
Cool! So it runs a command every time you type one and hit enter? And remembers things like variable values etc?


yes-ish

things like if statements, loops, and functions are obviously completely typed out before being run (switches to "..." then from ">>>")
Yeah, that makes sense.b Cool!
Kllrnohj wrote:
foamy3 wrote:
Ohhhh, okay. Now it's working. Thanks!


Also try out the interactive python session (go to start->programs->python->Python (command line))

that allows you to type python code and have it be run right away (thats why you saw those ">>> " before, that is the input line that the interactive session uses)


The GUI one works the same way if you don't open a file. That's why I was getting confused.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement