Marce1991
April 13th, 2004, 21:52
How may I "draw" a window in C++ for a program and add functions like File,
Options.Thanks!
Teamz
April 13th, 2004, 23:45
you can use Windows API if you're programming under Windows OS
MSDN is probably the best reference for win API: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing.asp
and here's a link for a tutorial : http://www.winprog.org/tutorial/
good luck
Azimer
April 14th, 2004, 03:48
You could always try using MFC ;-)
Marce1991
April 14th, 2004, 19:21
The tutorial that Teamz showed me is really good.But whats MFC?
Slougi
April 14th, 2004, 21:20
Microsoft Foundation Classes. Or something.
Slougi
April 18th, 2004, 13:07
#include <X11/Xlib.h>
#include <unistd.h>
int main() {
Display *dpy = XOpenDisplay(NULL);
if (dpy == NULL) fprintf(stderr, "Could not open X display!\n"), exit(1);
int blackColor = BlackPixel(dpy, DefaultScreen(dpy));
int whiteColor = WhitePixel(dpy, DefaultScreen(dpy));
Window w = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 200, 100, 0, blackColor, blackColor);
XSelectInput(dpy, w, StructureNotifyMask);
XMapWindow(dpy, w);
GC gc = XCreateGC(dpy, w, 0, NULL);
XSetForeground(dpy, gc, whiteColor);
for(;;) {
XEvent e;
XNextEvent(dpy, &e);
if (e.type == MapNotify) break;
}
XDrawLine(dpy, w, gc, 10, 60, 180, 20);
XFlush(dpy);
sleep(10);
}
Xlib programming rocks :rolleyes:
vBulletin v3.6.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.