LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   create a GUI in C that would work in any Linux distro (https://www.linuxquestions.org/questions/programming-9/create-a-gui-in-c-that-would-work-in-any-linux-distro-4175536615/)

DavidBrenner 03-13-2015 04:51 AM

create a GUI in C that would work in any Linux distro
 
Hi.

I want to create a Linux GUI for a Grub4Dos installer. Preferably using C and gcc as compiler.
You can find the C code of the console tool + the Windows GUI here: http://reboot.pro/topic/20238-improv...11#entry191228
I can create the console tool (grubinst) using the "make" command but most of the code from grubinst_gui can be used only in Windows.

The GUI must work in any Linux distro, without having to install additional software or to (re)compile it.

Which Linux IDE I can use for this?

What I've tried so far: Code Blocks with wxWidgets. But it works only with wxWidgets installed.

My OS: Fedora 21 x64 KDE.

Thank you for any help.

Regards,
David

vharishankar 03-13-2015 05:34 AM

I would go with GTK or Qt. Pretty much the standard GUI toolkits, shipping with most desktop oriented distributions. My personal preference is Qt.

NevemTeve 03-13-2015 05:50 AM

1. The IDE has nothing to do with this question.
2. There are linux-boxes without graphics, so your program won't work on every linux-box.

dugan 03-13-2015 11:15 AM

Quote:

Originally Posted by DavidBrenner (Post 5331443)
The GUI must work in any Linux distro, without having to install additional software or to (re)compile it.

If you're distributing binaries, then this isn't even a consideration. You just include the dependencies with the download.

Taking that requirement literally, however, I'd recommend giving it a text-based interface using ncurses (which is universal) or s-lang, instead of using a GUI toolkit.

metaschima 03-13-2015 11:52 AM

If you wanted a real GUI, I would say gtk or gtk2 would be your best bet. They are likely to be installed on nearly all Linux systems.

If the Linux system did not have Xorg, then you would go with ncurses as dugan suggests.

Blizzard 03-13-2015 03:46 PM

GTK are usually more wide spread than QT. Maybe, for maximum compatibility you may think to divide the logic from the interface and once the program logic is developed, you can implement various interfaces: from GTK to, at least, ncurses that will works everywhere.

John VV 03-13-2015 04:55 PM

ncurses

but WHY ??? "Grub4Dos"

the last update for that was back in 2009

so no secureboot or uefi support

so no new post 2012 hardware

DavidBrenner 03-14-2015 01:16 AM

1 Attachment(s)
Thank you, guys.

Well, I tried QT creator.
The form designer does not seem to work. And I don't see any list of controls I can add (see the screenshot).
Also I searched in menus/options and Google, but couldn't find how to compile a x86 ELF instead a x64 ELF (the OS is x64).

As for other advices: since I'm not a pro in Linux I could not understand them 100%.

Quote:

Originally Posted by John VV (Post 5331747)
ncurses

but WHY ??? "Grub4Dos"

the last update for that was back in 2009

so no secureboot or uefi support

so no new post 2012 hardware

Actually the last update was 11 days ago: https://github.com/chenall/grub4dos

veerain 03-14-2015 05:11 AM

Perhaps in some years BIOS would be history and UEFI only remaining.

DOS depends on BIOS for it's working (BIOS Interrupts). And it also adds it's own interrupt to this list.

But you can still use DOS in Qemu or VirtualBox or a dedicated machine.


All times are GMT -5. The time now is 07:22 AM.