drawing in the main window

Hello Everyone,

I'm trying to make my own software in C++, but I want to have it's own custom look and feel GUI. I also want it to have a solid codebase that I can move from platform to platform with little struggle.

Now, I figured out that the best way to do this is to actually draw the window and add the components. The thing is, how do you draw in the main window(e.g. desktop)

I use Windows XP and Linux if it helps
Also, I'd like to stay away from libraries if possible. I want to make my own library to port to different systems.

If you don't understand what I'm saying, I can be more specific

Cheers,
Monkey Coder
You are in for a world of hurt.

Why not use GTK or some other like library? Theming support is available for them. For a fairly comprehensive list of what's available, see:

The GUI Toolkit, Framework Page
http://www.free-soft.org/guitool/


If you really want to roll your own stuff, you'll need to visit MSDN for the Microsoft Win32 API. Here's a link to jump right in:

Graphics and Multimedia
http://msdn.microsoft.com/en-us/library/aa139759.aspx
(Click around the GDI stuff, and don't forget to use the left-frame to backup to "Win32 and COM Development" topics.)

The Forger's Win32 API Programming Tutorial
http://www.winprog.org/tutorial/

Windows API Tutorial
http://www.relisoft.com/win32/index.htm

Win32 Programming at FunctionX
http://www.functionx.com/win32/index.htm

Google around for more.


On Unix/Linux/etc you'll need to know something about X. (Stick with xlib -- don't bother dinking with xt.) The two most valuable references you'll find online are:

The Xlib Manual
http://tronche.com/gui/x/xlib/

Basic Graphics Programming With The Xlib Library
http://users.actcom.co.il/~choo/lupg/tutorials/xlib-programming/xlib-programming.html

Good luck!
First of all, thank you very much for your reply.

However, most of this stuff I already know or heard before :-(

Could someone get me a link to describe how toolkits like GTK+ work?

I want to modify an open source toolkit if I can.
No problem.

But, no offense, I don't think you realize the gems I just gave you. Windows GUI programming is not a trivial thing. Toolkits exist to make it doable on a regular basis.

If you want to learn how a toolkit works inside, you might want to take a look at some of the simpler ones, like

FLTK http://www.fltk.org/
Xaw (the original "howto") http://en.wikipedia.org/wiki/Xaw
LessTif http://www.lesstif.org/
Init 0 X11 Toolkit http://www.init0.nl/simplex11tk.php

Don't forget to peruse the Wikipedia too http://en.wikipedia.org/wiki/Xlib


There does not exist a simple way around it.
If you want to do this kind of stuff you must simply dive in and tackle a very steep learning curve.


Personally, for cross-platform GUI's, I usually resort to Tcl/Tk

Main site
http://www.tcl.tk/

Wiki
http://wiki.tcl.tk/

TkChat
http://wiki.tcl.tk/2619

Complete system installs (you probably already have Tcl/Tk installed in Linux, but even if you do and it is less than version 8.4, get Active State's anyway)
http://www.activestate.com/Products/activetcl/index.mhtml

TclKit -- "batteries included" no installation necessary. Just copy the tclkit shell and your application starkit (or bundle them together in a single binary starpack) to the target platform and execute it directly.
http://www.equi4.com/

TCL -- Tool Command Language -- is an extensible, easy to use, embeddable command interpreter which is designed to be usable from C and C++ programs. The source code for the tclsh and wish executables are also the prime examples of how to do just that.


Between these last two posts, you have a mountain of information to look through, and a gazillion options to choose from if you want to modify/contribute to an toolkit; and all the information you'll need to write your own.

Good luck now!
Topic archived. No new replies allowed.