Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

[C++] Best way to make GUIs in C++

Name: Anonymous 2012-05-18 0:58

I know everyone says not to make GUIs in C++, but what would you guys recommend if I were to do so?

Name: Anonymous 2012-05-18 1:00

What is your target platform?

Name: Anonymous 2012-05-18 1:05

Windows

Name: Anonymous 2012-05-18 1:18

Best way is switching to csharp

Name: Anonymous 2012-05-18 2:17

Qt
WxWidgets
GTK
Agar

Name: Anonymous 2012-05-18 4:02

CGI is piss-easy; just read a couple of environment variables (REQUEST_METHOD, PATH_INFO) and emit HTML.

If you want to run it locally on Windows workstations you could either package it with a light web server (NGinX? LigHTTPD?) set to run on port 8080 or just write a simple web server class:
/* pseudo-C */
void server(){
  int conn;
  int sock = socket(AF_INET, SOCK_STREAM, 0);
  bind(s, localhost 8080);
  listen(s, 1);
  while(conn = accept(s, &addr)){
    stdout = fdopen(conn, "w");
    printf("HTTP/1.0 200 OK\r\n");
    printf("Content-type: text/dicks\r\n\r\n");
    printf("<html><body><blink><marquee><h1>poo hole</h1></marquee></blink></body></html>\n");
  }
}


It doesn't have to handle multiple connections or anything fancy since there's only one user, and can maintain all sorts of gross state to make things even easier.

Name: Anonymous 2012-05-18 4:42

Might as well do it in Python.

Name: Anonymous 2012-05-18 5:19

>>7
A web server fully written in Python will never be as fast that one written in C.

Name: Anonymous 2012-05-18 5:29

>>8
What is your point? You may write performance critical modules in C and then use them in your Python program.

Name: Anonymous 2012-05-18 6:38

Not to mention your speed will be hampered because of the I/O.

Name: Cudder !MhMRSATORI!FBeUS42x4uM+kgp 2012-05-18 6:47

Win32(64?) API.

Name: Anonymous 2012-05-18 7:01

>>11
Are you trying to go from being merely a FrozenVoid Lite to full-on FV?

Name: Anonymous 2012-05-18 7:35

The best way to make GUIs in C++ is to make an interpreter of a declarative language that describe graphical primitives (think HTML but better). It's basically a scene graph renderer, so make rendering fast (C++) and GUI creation fast (DSL). This can often be faster than making everythin in C++, since C++ classes can't easily be broken up, i.e. what the virtual paint() method does is anyone's guess, and you're bound to the painter's algorithm. But the scenegraph can choose to render front-to-back, and other things.

Examples: Qt Quick, JavaFX, Flex, XUL Runner and XAML

Name: Anonymous 2012-05-18 7:40

>>12
Cudder
recommending the win32 API
being FV
No.

Name: Anonymous 2012-05-18 8:01

>>1
by making them

Name: no 2012-05-18 12:22

>>11
no

Name: Anonymous 2012-05-18 20:20

QT 4 </thread>

Name: bampu pantsu 2012-05-29 5:02

bampu pantsu

Name: Sgt.Kabu縪kiman뻋� 2012-05-29 13:32

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List