LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Rapid Linux GUI Frameworks (http://www.linuxquestions.org/questions/programming-9/rapid-linux-gui-frameworks-941544/)

thund3rstruck 04-24-2012 04:51 PM

Rapid Linux GUI Frameworks
 
I'm currently a C#.NET developer in the business world and I'm a hobbyist Linux admin and consultant. I'd love to produce the kinds of high quality enterprise application on Linux that I produce in Windows but I'm really struggling to grasp the right direction.

Currently, I have written a ton of BASH applications that use a really simplistic Zenity UI and I just can't take that anymore. I spent some time writing Java programs but Java (Swing) just isn't suited for system admin applications that are designed to interface directly with the Operating System.

I need a real UI framework. I have recently switched gears and started down the path of Python/wxPython but then I realized that none of my Linux machines even have wxPython installed by default and there are known problems using wxPython on Gnome 3.

for the love of god, is there any standard UI framework included by default on (the enterprise) distributions like the .NET framework is on Windows machines that I can generally count on being on the machine?

Please don't say Qt or Gtk+, because I detest the idea of going back to C/C++, especially after having spent the last 10 years focusing on high-level languages.

Cheers!

acid_kewpie 04-24-2012 04:59 PM

I don't think your desire for something "installed by default" is appropriate. Why would wxPython be there by default? It's pretty obscure, and would just clutter up most systems. There's nothing wrong with installing stuff...

Maybe a tool like Glade would be of use? Building GTK interfaces for various languages, including C#.

and having "for the love of god" with a Dawkins quote in the same post... interesting!

TobiSGD 04-24-2012 05:03 PM

Which frameworks are included is totally dependent on the distro you use, but you can say that a standard install of a distro almost ever has GTK+ and QT installed (or at least one of the two, i think most distributions favor GTK+). And no, you don't have to use C/C++ to use them, there are bindings for almost any language.
But anyways, if you make proper packages out of your software the package manager will take care of installing necessary dependencies, so actually you don't have to be concerned about that.

EDIT: @ acid_kewpie: All versions of GTK are called GTK+, with GTK+ 3.4.0 being the last stable version.

acid_kewpie 04-24-2012 05:09 PM

Hmm, yeah, I always saw gtk+ and gtk2 when I developed in it... my bad.

dugan 04-24-2012 05:50 PM

Quote:

Originally Posted by thund3rstruck (Post 4662098)
I'm currently a C#.NET developer...

You know that C# and WinForms are available in Linux (with Mono), right?

thund3rstruck 04-24-2012 08:23 PM

Quote:

Originally Posted by dugan (Post 4662129)
You know that C# and WinForms are available in Linux (with Mono), right?

Yup, been down that road 4 or 5 years ago and Mono is a weak, pathetic .NET imposter.

Quote:

I don't think your desire for something "installed by default" is appropriate. Why would wxPython be there by default? It's pretty obscure, and would just clutter up most systems.
Again, Linux development is a hobby for me at this point so I really have no idea of what is standard and what is obscure. It sounds like GTK+ and Qt are in fact the way to go, except I need to use bindings for higher-level languages (anyone care to point me to a link where this is effectively articulated?). There doesn't seem to be any sort of MSDN Library out there for Linux development and all the books I've looked all use C/C++ or Python with one of a possible zillion GUI frameworks.

Quote:

But anyways, if you make proper packages out of your software the package manager will take care of installing necessary dependencies, so actually you don't have to be concerned about that.
Care to share some documentation on how to build proper packages? In Windows all I need to do is deliver my libraries in the same working directory as the assembly or register them in the GAC (or Enterprise Services Mgr for COMVisible components) and this work is always achieved as part of the MSI installer package that the software is deployed in.

Thanks again guys....I'm hoping this time around I can make some progress in Linux development. The last few times I tried Linux development I got so overwhelmed by the lack of any standards, documentation, and direction that I threw my hands up and walked away. The last thing I want is to pick the wrong framework and have wasted hundreds of hours of precious time.

dugan 04-24-2012 08:37 PM

Quote:

Originally Posted by thund3rstruck (Post 4662213)
Yup, been down that road 4 or 5 years ago and Mono is a weak, pathetic .NET imposter.

* ahem

You think it might have changed in 4-5 years?

If you really want a recommendation and you don't want to look at what the current state of Mono is, then you really can't go wrong with PyQt. Definitely not "the wrong framework". It's what I used for my music player (http://duganchen.ca/quetzalcoatl-2-0-screenshot/)

You can buy a book on it:

http://www.qtrac.eu/pyqtbook.html

It has the same API (classes and methods) as Qt, so I usually just read the C++ Qt docs (which are IMHO better than MSDN) and mentally translate them to Python.

Quote:

Care to share some documentation on how to build proper packages?
Let the specialists do that.

If your software is open source, then just release source tarballs and let people who build packages for their distributions do it.

If it's not, then just release statically linked binaries, tar them up, and let people who build packages for their distributions package them.

Quote:

I detest the idea of going back to C/C++
Rumor has it that C++ is going to become prevalent for development on Microsoft platforms again.

TobiSGD 04-24-2012 09:44 PM

Quote:

Originally Posted by thund3rstruck (Post 4662213)
Care to share some documentation on how to build proper packages? In Windows all I need to do is deliver my libraries in the same working directory as the assembly or register them in the GAC (or Enterprise Services Mgr for COMVisible components) and this work is always achieved as part of the MSI installer package that the software is deployed in.

Forget how it is done in Windows. Linux is not Windows, so don't expect it to act like Windows.
Regarding packages, it depends type of packages your distribution uses, the most common are RPM and DEB.

Zssfssz 04-25-2012 01:14 AM

Ruby is not standard on any Linux distro I know of (even the enterprise ones) BUT Tk is part of the Standard, yes standard not extended standard, ruby library.
This is a C++ solution (C++ isn't THAT low level... Is it? Compare it to assembly) but FLTK is super easy (I learned it in one day, and I'm not even that familiar with classes) and is small enough to be stately linked.

thund3rstruck 04-25-2012 08:46 AM

Quote:

Originally Posted by TobiSGD (Post 4662257)
Forget how it is done in Windows. Linux is not Windows, so don't expect it to act like Windows.
Regarding packages, it depends type of packages your distribution uses, the most common are RPM and DEB.

I can't forget how it is done in Windows because I've been developing Windows applications for over a decade. I've been a Linux user and some-time admin longer than I have been a Windows developer so I'm very familiar with Linux (I have 3 Linux certifications)... I'm just new to Linux development. I don't expect Linux development to be anything like Windows development but I have never overcome the lack of an MSDN Library style of direction.

Quote:

You think it (MONO) might have changed in 4-5 years? If you really want a recommendation and you don't want to look at what the current state of Mono is...
I know there have been some great applications developed with Mono (Banshee, etc) but I went down that road several times and it was not even close to the real .NET framework, not only that but Mono is effectively dead, having lost its Novell sponsership (http://www.readwriteweb.com/hack/201...ew-startup.php)

Quote:

then you really can't go wrong with PyQt. Definitely not "the wrong framework". It's what I used for my music player
That looks good but isn't Qt a KDE thing? I'm trying to stay in the mainstream here so I'm going to give a go with PyGTK/PyGObject.

I think I found a decent starting point for Linux GUIs here:
http://python-gtk-3-tutorial.readthe...est/index.html

I'll worry about how to implement multi-threading, locks, interprocess communication, OR/M persistence, and other deeper requirements once I understand the GTK+ object model and work through the tutorial.

Thanks again everyone!

TobiSGD 04-25-2012 08:53 AM

Quote:

Originally Posted by thund3rstruck (Post 4662647)
That looks good but isn't Qt a KDE thing? I'm trying to stay in the mainstream here so I'm going to give a go with PyGTK/PyGObject.

Qt is in the same way a KDE thing like GTK+ is a Gnome thing. Those DEs are built on it, that's it.

dugan 04-25-2012 09:45 AM

Quote:

Originally Posted by thund3rstruck (Post 4662647)
I think I found a decent starting point for Linux GUIs here:
http://python-gtk-3-tutorial.readthe...est/index.html

I'll worry about how to implement multi-threading, locks, interprocess communication, OR/M persistence, and other deeper requirements once I understand the GTK+ object model and work through the tutorial.

Sounds like you're ready to mark the thread as SOLVED, and you've chosen Gtk via Python. That's not wrong. Not at all.

And for GTK, there are GtkSharp (Mono again) and Vala in addition to the Python bindings.

However...

(Py)Qt is not in any way tied to KDE, and it's really as mainstream as GTK. I haven't checked, but wouldn't surprise me at all if even GNOME-based distributions are shipping it on their install DVDs. Again, definitely not the wrong framework. You also shouldn't be worrying about what software comes with the typical mainstream distribution because a) there's no such thing, b) all distributions make software and their dependencies very easy to install, c) no-one limits themselves to the software in a stock install, and d) etc.

Here's how multithreading in Qt works, including locks:
http://qt-project.org/doc/threads.html

Here's database ORM for Python. Which of course plays nicely with both PyQt and PyGTK:
http://www.sqlalchemy.org/

thund3rstruck 04-25-2012 09:47 AM

Absolutely outstanding! Thank you guys so much for all the assistance!

Sergei Steshenko 04-27-2012 01:48 PM

Quote:

Originally Posted by thund3rstruck (Post 4662697)
Absolutely outstanding! Thank you guys so much for all the assistance!

I suggest to read http://mail.gnome.org/archives/gtk-l.../msg00016.html thread.

I think that objectively Qt is a better choice - even though I'm using gtk+ in its Perl bindings form - I needed Perl bindings.

dugan 04-27-2012 05:49 PM

Quote:

Originally Posted by Sergei Steshenko (Post 4664709)
I think that objectively Qt is a better choice.

It is. It's significantly less verbose than GTK.


All times are GMT -5. The time now is 02:49 PM.