LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-22-2016, 01:41 AM   #1
myewaccc1
LQ Newbie
 
Registered: Mar 2016
Posts: 5

Rep: Reputation: Disabled
Best/Simplest way to create GUI for linux


Hi,
I need to write a simple application that will run on Linux (not knowing exactly which distribution). I want it to be as native as possible, so the fewer changes i need to make to the end user environment the better (i'd like to avoid 3rd party software installation).

The application will be very simple, which will contain a GUI very similar to an installer (Next, Next , OK, Next, etc'...).
Any recommendation on which language to use? which GUI libs to use?

I am considering using python and tkinter , but that might cause me to have to install/update python on the client. also C++ and QT is another choice i am considering.
Any recommendation?
 
Old 03-22-2016, 02:47 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Non. Je suis propriétaire – No. I am an owner.
Distribution: Apple-selling shops, markets and direct marketing: customers find the farm and buy apples.
Posts: 1,608
Blog Entries: 40

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
Quote:
Originally Posted by myewaccc1 View Post
Hi,
I need to write a simple application that will run on Linux (not knowing exactly which distribution). I want it to be as native as possible, so the fewer changes i need to make to the end user environment the better (i'd like to avoid 3rd party software installation).
If you can write shell scripts, take a look at Zenity and Yad.

Quote:
The application will be very simple, which will contain a GUI very similar to an installer (Next, Next , OK, Next, etc'...).
Any recommendation on which language to use? which GUI libs to use?

I am considering using python and tkinter , but that might cause me to have to install/update python on the client. also C++ and QT is another choice i am considering.
Where you write “simple” for the application, it is not quite clear if the simplicity applies to the user-interface or the underlying application code. As you lay emphasize on the GUI-aspect, I cling to my suggestion of a shell-script that you write against Zenity or Yad. This allows a potential end-user to quickly make her/his own modifications, when necessary. You would concentrate all variable-definitions on top of the script. This is very comfortable.

When you talk about python and C++, you enter another universe. Between tkinter and Qt, you find other frameworks which should be considered, notably gtk2 and gtk3. Also, semi-graphics like with newt or ncurses are a possibility.

If you have experience with Qt, you know how to write a simple interface and the robustness of this framework should make the decision easy. Small projects with Qt are fun to write. Personally I cannot give you more recommendations. Myself I have written some nice GUIs with Ruby/Gtk2 and -3. The Python-bindings should work just as well or even better that in Ruby... But coding C++ with Qt “feels” more natural to me, although (or because) it asks for a more scrupulous project-organization.

Anyway.., I believe that you should try Yad.

Last edited by Michael Uplawski; 03-22-2016 at 02:51 AM.
 
1 members found this post helpful.
Old 03-22-2016, 02:56 AM   #3
OregonJim
Member
 
Registered: Feb 2016
Posts: 98

Rep: Reputation: Disabled
Quote:
Originally Posted by myewaccc1 View Post
,
I want it to be as native as possible, so the fewer changes i need to make to the end user environment the better (i'd like to avoid 3rd party software installation).
[...]
I am considering using python and tkinter , but that might cause me to have to install/update python on the client.
The two statements above are a bit contradictory.

If you want it to be as native as possible, that means packaging your application in a .deb or .rpm file (or similar). That is the "native" way to install applications on Linux. If you do that, there is no need to worry about having to install python, libraries, or other dependencies, as the distribution's package manager will do it for you.
 
Old 03-22-2016, 04:25 AM   #4
myewaccc1
LQ Newbie
 
Registered: Mar 2016
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by OregonJim View Post
The two statements above are a bit contradictory.

If you want it to be as native as possible, that means packaging your application in a .deb or .rpm file (or similar). That is the "native" way to install applications on Linux. If you do that, there is no need to worry about having to install python, libraries, or other dependencies, as the distribution's package manager will do it for you.
Well, just to be clear : the optimal situation will be to give the user a single executable file, which will open up the gui (simple installer like gui - next next next...), and thats it - no installation required.
Also, i cannot count on the user to have an internet connection.
 
Old 03-22-2016, 06:11 AM   #5
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Non. Je suis propriétaire – No. I am an owner.
Distribution: Apple-selling shops, markets and direct marketing: customers find the farm and buy apples.
Posts: 1,608
Blog Entries: 40

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
PSE comment on the propositions made in this thread (above and below this post) and the way that they correspond or do not correspond to your needs...
Quote:
Originally Posted by myewaccc1 View Post
Also, i cannot count on the user to have an internet connection.
What? ... erm okay.
 
Old 03-22-2016, 09:40 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by myewaccc1 View Post
Well, just to be clear : the optimal situation will be to give the user a single executable file, which will open up the gui (simple installer like gui - next next next...), and thats it - no installation required.
Also, i cannot count on the user to have an internet connection.
you seem to sound more Windows orientated in doing things. as others have said, deb, rpm, even straight source code using
Code:
./configure
make
make install
--
py.setup
sh myscript.sh
etc..
these are the ways of Linux, unless installing the complete system itself as far as a GUI setup to install applications.

As far as not having internet to get any dependencies that maybe needed to ensure that your program will run. then you'll have to ensure that it is dependent independent, or have all of the dependencies it needs to run bundled into your means of installing said application. and scripted to install them first and in the order they need to be installed as well. before installing your application.

the no installation required, hum java perhaps to just run a program may work. never tried ruining a java program with everything on the usb stick though the environment has to be established first, regardless of what language you use in order for a program to run.

I think you need to shift gears and think LINUX first, then get to understand how things are done with Linux in the we don't use GUI install programs to install programs that do not install but only run, first. Then go from there perhaps.

you might as well as develop a live Linux usb stick with whatever program you want the user to use so he does not have to install anything nor worry about not having internet. Problem solved. but I could be wrong.

Last edited by BW-userx; 03-22-2016 at 09:58 AM.
 
Old 03-22-2016, 09:43 AM   #7
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i use zenity whenever i want a quick-and-dirty menu gui.
 
Old 03-22-2016, 01:27 PM   #8
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Non. Je suis propriétaire – No. I am an owner.
Distribution: Apple-selling shops, markets and direct marketing: customers find the farm and buy apples.
Posts: 1,608
Blog Entries: 40

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
I forgot something. Or rather: Actively ignored Java, Swing and SWT.
  • These GUIs can be part of a single jar-file that may also contain all of the remaining program-code.
  • Execution may be a simple call of the Java executable with the jar-file as argument.
  • The development is not quick, but the result may be dirty.
  • In theory, the program and the GUI can be platform-independent.

For a small application (huge compared to C++, Python, Ruby, Shell-scripting... a bunch of alternatives), Java may be a possible answer. If you are lucky.

If not, the program is not working alike or not at all on all platforms, the user chooses a virtual machine which is accidentally (only) this time not compatible with your choice of code and libraries, something in SWT or Swing has changed or in the Java-standard, which renders your project incompatible with itself (and String an undefined class, remember that one?).

You don't get money for it - don't code Java.

Last edited by Michael Uplawski; 03-22-2016 at 01:29 PM.
 
1 members found this post helpful.
Old 03-22-2016, 01:49 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
why don't you re-summarize what it is you are actually wanting to do because you have been adding to this project one post at a time. gather all of your thoughts on this matter into one sock then write it out in a format that everyone body can understand. Thank you
 
Old 03-22-2016, 01:55 PM   #10
OregonJim
Member
 
Registered: Feb 2016
Posts: 98

Rep: Reputation: Disabled
Quote:
Originally Posted by myewaccc1 View Post
Well, just to be clear : the optimal situation will be to give the user a single executable file, which will open up the gui (simple installer like gui - next next next...), and thats it - no installation required.
Also, i cannot count on the user to have an internet connection.
Optimal for whom? Most everyone in the Linux world (especially newbies) expects pre-compiled applications to be installed via the package manager these days. Building from source is another story.

Single-file executables have a number of drawbacks. You must statically link all libraries (which makes the application huge), and those libraries won't get security updates the way shared libraries do, risking your users' systems. You can also run into compatibility problems if your program communicates with other programs via an API defined in those libraries.

Of course, you can do it any way you want. I'm just pointing these things out to save you some support headaches. Also, you haven't told us the scope of your application, or who the target audience is. If this is something for just a few friends, you can get away with non-standard methods - but if you intend to release it into the community, it won't fly very far if it's not packaged.
 
Old 03-22-2016, 10:58 PM   #11
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,198

Rep: Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307
If this is a game then look into mojosetup.
 
Old 03-23-2016, 07:11 AM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,609
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
Google things like "linux kiosk applications." My initial impression of this requirement is that it is a thing which has already been done many times before. You don't have to "start from scratch," frankly, with almost anything these days.

The naturally multi-layered architecture of XOrg/XWindows can be very light-weight: you can have "a windowed graphic presentation" without carrying around the rather-beefy overhead of "a complete desktop/GUI environment." This is ideal for things like kiosks and installers.
 
Old 03-28-2016, 03:00 AM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Back in the day you could do simple gui stuff with TK/TCL. I remember it being almost a one liner to make a slider to adjust video brightness. Although never really easy on the eyes.
 
Old 03-28-2016, 12:36 PM   #14
OregonJim
Member
 
Registered: Feb 2016
Posts: 98

Rep: Reputation: Disabled
Quote:
Originally Posted by Shadow_7 View Post
Back in the day you could do simple gui stuff with TK/TCL. I remember it being almost a one liner to make a slider to adjust video brightness. Although never really easy on the eyes.
You can still do it that way, though the 'modern' equivlent is python/tkinter.
 
Old 03-28-2016, 12:59 PM   #15
Teufel
Member
 
Registered: Apr 2012
Distribution: Gentoo
Posts: 616

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by myewaccc1 View Post
I need to write a simple application that will run on Linux (not knowing exactly which distribution). I want it to be as native as possible
It rather depends on which DE do you plan to write for, because different DEs has their different libraries that provides GUI elements.

Quote:
Originally Posted by myewaccc1 View Post
The application will be very simple, which will contain a GUI very similar to an installer (Next, Next , OK, Next, etc'...).
Any recommendation on which language to use? which GUI libs to use?
In KDE I use shell scripting + standard KDE Dialogs
It's very simple to use, it looks natively and has a lot standard pre-built stuffs.

Take a look:
https://techbase.kde.org/Development...th_KDE_Dialogs
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] create a GUI in C that would work in any Linux distro DavidBrenner Programming 8 03-14-2015 05:11 AM
Squeeze: Simplest method to create a 5MB Ramdisk? patrick295767 Debian 3 08-09-2012 10:27 AM
New, and looking for the simplest version of linux. Lancil Linux - Newbie 23 05-23-2011 06:56 AM
how to create a GUI for a C++ application running on linux 64 and AMD turion64 fantomas52 Linux - Newbie 7 05-11-2006 08:54 PM
Simplest way to uninstall Linux? janneh Linux - General 2 10-05-2003 09:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration