Buttons and Graphics

Im thinking off trying to add some stuff to my project i would like to add some graphics and some buttons whats the best update or whatever call it for that???

And also how do i do it??
This is very much the same question you asked about trying to make C++ more "stylish".

You NEED to use a GUI Toolkit OR Code your Windows directly using Win32 API. There isn't really any other way.

With Dev-C++. You can install Dev-Paks from their Website Manager Tool, or from a site like www.devpak.org. Some of the available GUI Toolkits (last time I checked) are FLTK, WxWidgets/wxWindows, GTK, Fox (Maybe).

Otherwise, Download a copy of a Win32 API Reference file and look up "CreateWindow" function.
Last edited on
Hmm i dwnloaded some off the Toolkits except i dunno how to use them......im using Bloodshed Dev-C++ for anyone who doesnt know already
There is no 1-answer for all Toolkits unfortunately. This is a downside of C++ and Graphical Application Programming.

Each toolkit has it's own VERY different API, Rules and Syntax. Unless you have programmed in it before, then you are going to have to do some very serious studying of the tutorials for that toolkit. Myself, I have worked in FLTK (not for many years) and WxWidgets. So I am of no use to someone working in QT or GTK specific code. You will need to pick the one you are keen in using, and head off to their website and go through their tutorials. Each Toolkit will be as difficult (if not more) than learning C++ again unfortunately.
I have 2 things one is called FLTK 1.1.9 and also something called Allegro but i dont even know what i do or how to do something with them??? If i can get them working then i could mess about and see what all the functions are and do but i dont know how to get it working...
Last edited on
You will need to head to the FLTK website and look at their tutorials and documentation. They have their own VERY specific implementation of things.

Im on the FLTK webby been on all day...it tells u how to use it and etc but not how to get it too start up...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>

int main(int argc, char **argv) {
  Fl_Window *window = new Fl_Window(300,180);
  Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!");
  box->box(FL_UP_BOX);
  box->labelsize(36);
  box->labelfont(FL_BOLD+FL_ITALIC);
  box->labeltype(FL_SHADOW_LABEL);
  window->end();
  window->show(argc, argv);
  return Fl::run();
}


Thats their code for a Hello World example. You should be able to compile that and run it with no problem is FLTK is installed.

http://www.fltk.org/documentation.php/doc-1.1/basics.html#basics
It says linker problem like last time i copied that src...
Goto
http://www.fltk.org/documentation.php/doc-1.1/basics.html#basics

Scroll down to "Compiling Programs with Standard Compilers". You need to add the libraries in for your linker to use.
ZOMG im so stupid i was making just plain codes when i should have been making Projects lol xD i think it should be outlined more
They can't outline it. Because they don't know which of a dozen+ IDEs you are using across multiple-platforms.

You could be using
VI/Command Line with GCC/BCC
Eclipse
Visual Studio 6
Visual Studio .NET
Dev-C++
Anjuta
Code::Blocks
NetBeans
// Just to name but a few of the IDEs. Each one VERY different from the last.

And, if you were just compiling it from a command line, then you would have no "projects" etc. Just execute the command against your compiler directly.
Right now i done all that and know how to put graphics in how do i make my own graphics paint???
Explain more please. What do you want to achieve?
This is a guess, but I suspect you want to draw pictures on the screen, lines shapes etc. If you had Visual Studio I'd say start looking at the MFC CDC class. For the really clever stuff you need DirectX or OpenGL. I don't know if Bloodshed Dev-C++supports any of these.

Judging by your other posts, asking to be taught C++ etc, I think you are still learning the language. It would not recommend attempting to use any of these packages without a good grounding in C or C++ first. Walk before you try and run otherwise you'll end up very frustrated and disillusioned with the whole thing.
All compilers have OpenGL support. You don't need additional libraries for it :) So that includes MingW under Dev-C++. Dev-C++ also should have DirectX DevPaks.

Topic archived. No new replies allowed.