Ubuntu – How to create Ubuntu graphic C programs without Gtk
application-developmentcgraphicsgtk
Is there some sort of program or something to turn your text program graphical in C?
Thank You,
CCM
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){
fgets(answer,sizeof(answer),zenity);
printf("User's answer:%s\n",answer);
exit(0);
}
// we get here if above check failed
perror("zenity exited with non-zero exit code");
return 0;
}
This will launch Firefox using the Simple/Adwaita:light theme, which is pretty basic and should blend with your Persona. You can try other themes, by replacing Simple with the theme name, but this doesn't work with all themes.
So far I have successfully tested with Simple and Redmond themes...
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.