Ubuntu – How to create Ubuntu graphic C programs without Gtk


Is there some sort of program or something to turn your text program graphical in C?

Thank You,


Best Answer

Here's a simple way with calling external program - zenity. This way your command-line C code is now a GUI app by virtue of using zenity's simple input popup dialog, although this method isn't particularly secure.

#include <unistd.h>
#include <stdio.h>

int main(){
    FILE *zenity;
    char answer[getpagesize()];

    if ((zenity = popen("zenity --entry","r")) != NULL){

        printf("User's answer:%s\n",answer);
    // we get here if above check failed
    perror("zenity exited with non-zero exit code");

    return 0;
Related Question