freestyler wrote:I have been playing around a bit with gtkdialog lately and now I am looking into developing "real" applications.
Can anyone give me a heads up on what would be the best language to use and what software I should use to make it? I have dabbled with qtcreator and kdialog before but want to move towards something more universal for linux.
The best way for:
Windows: WinAsm + win32api (
http://www.winasm.net/)
Linux: C + system calls(
http://www.opennet.ru/man_2_eng.shtml) + libc(
http://www.opennet.ru/man_3_eng.shtml) + Xlib(
http://tronche.com/gui/x/xlib/)
For example (Linux):
//------------------------------------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <X11/Xlib.h>
int main()
{
Display *dsp;
XSetWindowAttributes att;
Window win;
unsigned long mask;
int screen;
int width = 640;
int height = 480;
if((dsp = XOpenDisplay(NULL)) == NULL)
{
fprintf(stderr, "Could not open display.\n");
exit(0);
}
screen = XDefaultScreen(dsp);
att.event_mask = ExposureMask|ButtonPressMask|ButtonReleaseMask|KeyPressMask;
att.background_pixel = XWhitePixel(dsp, screen);
att.border_pixel = XBlackPixel(dsp, screen);
mask = CWEventMask|CWBackPixel|CWBorderPixel;
win = XCreateWindow(dsp, XRootWindow(dsp, screen), 0, 0, width, height, 1, CopyFromParent, InputOutput, CopyFromParent, mask, &att);
XMapWindow(dsp, win);
XFlush(dsp);
sleep(10);
XCloseDisplay(dsp);
return 0;
}
//------------------------------------------------------------------------------------------
Save it as main.c and compile with: cc -o main main.c -lX11