Getting started

For discussions about programming and projects not necessarily associated with Porteus.
Post Reply
User avatar
freestyler
Contributor
Contributor
Posts: 382
Joined: 17 Oct 2013, 14:21
Distribution: Porteus KDE4
Location: Traveller
Contact:

Getting started

Post#1 by freestyler » 29 Mar 2014, 06:44

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.
https://www.porteus-apps.org

User avatar
brokenman
Site Admin
Site Admin
Posts: 5460
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v3.2rcX all desktops
Location: Brazil
Contact:

Re: Getting started

Post#2 by brokenman » 02 Apr 2014, 02:44

I would have to recommend C++ as a base. It is the underlying layer of most applications. Apart from that perhaps qt or gtk which are both widely used among unices and plenty of IDE's support this.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
freestyler
Contributor
Contributor
Posts: 382
Joined: 17 Oct 2013, 14:21
Distribution: Porteus KDE4
Location: Traveller
Contact:

Re: Getting started

Post#3 by freestyler » 02 Apr 2014, 05:44

Cheers brokenman, that's what I thought. Just started learning about c++, it's pretty awesome stuff. Also stated messing around with glade. Since I got porteus I'm becoming such a geek :)
https://www.porteus-apps.org

User avatar
RamonTavarez
Contributor
Contributor
Posts: 81
Joined: 14 Mar 2011, 12:00
Distribution: 32 bit, KDE
Location: Dominican Republic

Re: Getting started

Post#4 by RamonTavarez » 04 Apr 2014, 12:52

1.- What about CLANG and LLVM?

2.- Is there an IDE that works with it?
Ramón E. Tavárez

User avatar
sabir
White ninja
White ninja
Posts: 12
Joined: 14 May 2014, 19:54
Distribution: Porteus LXDE 32
Location: Russia

Re: Getting started

Post#5 by sabir » 15 May 2014, 18:48

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 :)

User avatar
freestyler
Contributor
Contributor
Posts: 382
Joined: 17 Oct 2013, 14:21
Distribution: Porteus KDE4
Location: Traveller
Contact:

Re: Getting started

Post#6 by freestyler » 16 May 2014, 02:37

cheers :)
https://www.porteus-apps.org

Post Reply