Simplest way to create a GUI?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

CortoPasta
Posts: 38
Joined: Fri Aug 15, 2008 5:51 pm UTC

Simplest way to create a GUI?

Postby CortoPasta » Tue Oct 13, 2009 5:17 pm UTC

Have a few simple programs I want to write for work to make things easier on me(i.e. use a program to answer questions/solve problems instead of me), but no one seems to understand how to use a program that doesn't have buttons to click. I don't need anything fancy, something to allow text inputs and the ability to select options by clicking on buttons (similar to how windows calculator works). Any ideas on how to come up with a simple GUI?

User avatar
Jorpho
Posts: 6291
Joined: Wed Dec 12, 2007 5:31 am UTC
Location: Canada

Re: Simplest way to create a GUI?

Postby Jorpho » Tue Oct 13, 2009 5:27 pm UTC

I'm partly inclined to suggest Visual Basic Express, but I've never used that myself. LabVIEW is another excellent idea, but if you don't have that somewhere already, it costs a whole lot of money.

So far all my dabbling has been in Python with PyGTK and Glade, which works well enough, but takes some getting used to.

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Simplest way to create a GUI?

Postby Xanthir » Tue Oct 13, 2009 5:31 pm UTC

Learn javascript/some server-side language, and use HTML and CSS. You've got an entire easy gui language right there.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

stinch
Posts: 39
Joined: Sun Feb 24, 2008 12:37 am UTC
Location: Oxford, UK

Re: Simplest way to create a GUI?

Postby stinch » Tue Oct 13, 2009 8:54 pm UTC

I often use C#/vb.net for windows GUI programs. You can throw together simple stuff without too much complication.

User avatar
thoughtfully
Posts: 2253
Joined: Thu Nov 01, 2007 12:25 am UTC
Location: Minneapolis, MN
Contact:

Re: Simplest way to create a GUI?

Postby thoughtfully » Tue Oct 13, 2009 9:55 pm UTC

I found this with google.
Oh, the language underneath is GNAT, GNU Ada. Have fun with that :)

There are a couple good Glade articles in Linux Journal, you can find them from google using "site:linuxjournal.com", but javascript does sound like the quickest way to get something going.
Image
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

User avatar
Sc4Freak
Posts: 673
Joined: Thu Jul 12, 2007 4:50 am UTC
Location: Redmond, Washington

Re: Simplest way to create a GUI?

Postby Sc4Freak » Wed Oct 14, 2009 2:29 am UTC

.NET and WinForms was kinda designed for easy-to-create interfaces. Visual Studio includes a drag-and-drop, WYSIWYG editor for GUI applications. So I second (third?) the recommendations for VB.NET/C#.

qbg
Posts: 586
Joined: Tue Dec 18, 2007 3:37 pm UTC

Re: Simplest way to create a GUI?

Postby qbg » Wed Oct 14, 2009 3:49 am UTC

Overkill: Qt Designer (it's integrated in Qt Creator).

User avatar
Arancaytar
Posts: 1642
Joined: Thu Mar 15, 2007 12:54 am UTC
Location: 52.44°N, 13.55°E
Contact:

Re: Simplest way to create a GUI?

Postby Arancaytar » Wed Oct 14, 2009 3:13 pm UTC

Xanthir wrote:Learn javascript/some server-side language, and use HTML and CSS. You've got an entire easy gui language right there.


Yeah, you can pretty much use any scripting language (Perl, Python, Ruby work just as well as PHP). I also recommend jQuery to enhance the client-side UI scripting - everything becomes easier, including animated controls, AJAX, drag&drop interfaces, etc.

The downside is that your users will have a hard time using it locally, because they'd need a web-server as well as whatever scripting language you're using. You could try bundling it with lighttpd or something, but you'd need detailed knowledge of the Linux packaging system (let alone Windows installers) to make it easy.
"You cannot dual-wield the sharks. One is enough." -Our DM.
Image

User avatar
Area Man
Posts: 256
Joined: Thu Dec 25, 2008 8:08 pm UTC
Location: Local

Re: Simplest way to create a GUI?

Postby Area Man » Wed Oct 14, 2009 3:43 pm UTC

Tcl/Tk is made for this purpose.
Though, you didn't mention if you already know any programming language. Most have some sort of GUI libraries available.
Bisquick boxes are a dead medium.

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Simplest way to create a GUI?

Postby Xanthir » Wed Oct 14, 2009 5:10 pm UTC

Arancaytar wrote:
Xanthir wrote:Learn javascript/some server-side language, and use HTML and CSS. You've got an entire easy gui language right there.


Yeah, you can pretty much use any scripting language (Perl, Python, Ruby work just as well as PHP). I also recommend jQuery to enhance the client-side UI scripting - everything becomes easier, including animated controls, AJAX, drag&drop interfaces, etc.

The downside is that your users will have a hard time using it locally, because they'd need a web-server as well as whatever scripting language you're using. You could try bundling it with lighttpd or something, but you'd need detailed knowledge of the Linux packaging system (let alone Windows installers) to make it easy.

I wasn't suggesting making a *local* app with webapp technologies. That'd be silly. Just run an actual webapp. You know, on the web.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
TNorthover
Posts: 191
Joined: Wed May 06, 2009 7:11 am UTC
Location: Cambridge, UK

Re: Simplest way to create a GUI?

Postby TNorthover » Wed Oct 14, 2009 5:11 pm UTC

Area Man wrote:Tcl/Tk is made for this purpose.

That and to show people what GUIs look like when they've been hit by the ugly stick.

User avatar
'; DROP DATABASE;--
Posts: 3284
Joined: Thu Nov 22, 2007 9:38 am UTC
Location: Midwest Alberta, where it's STILL snowy
Contact:

Re: Simplest way to create a GUI?

Postby '; DROP DATABASE;-- » Wed Oct 21, 2009 6:18 am UTC

GTK is decent, though it depends what kind of interface you want:
Ugly: piece of cake.
Non-ugly, on *nix: Moderate effort.
Non-ugly, on Windows: Not possible.

It can be a little complex, but it's very well documented, for the most part. (See also my happy-rant about GTK+Lua.)
poxic wrote:You suck. And simultaneously rock. I think you've invented a new state of being.

User avatar
Emu*
Posts: 689
Joined: Mon Apr 28, 2008 9:47 am UTC
Location: Cardiff, UK
Contact:

Re: Simplest way to create a GUI?

Postby Emu* » Sun Oct 25, 2009 3:21 pm UTC

Javascript is a world of pain best avoided until after you've learnt a real programming language.
Cosmologicon wrote:Emu* implemented a naive east-first strategy and ran it for an hour, producing results that rivaled many sophisticated strategies, visiting 614 cells. For this, Emu* is awarded Best Deterministic Algorithm!

User avatar
Xanthir
My HERO!!!
Posts: 5426
Joined: Tue Feb 20, 2007 12:49 am UTC
Location: The Googleplex
Contact:

Re: Simplest way to create a GUI?

Postby Xanthir » Sun Oct 25, 2009 4:22 pm UTC

Emu* wrote:Javascript is a world of pain best avoided until after you've learnt a real programming language.

Balderdash. The DOM APIs are a world of pain best avoided at all costs, forever, no matter what. Javascript is a beautiful functional language with a very interesting prototype-based object model, and is likely more powerful than what you're referring to as a "real" programming language.
(defun fibs (n &optional (a 1) (b 1)) (take n (unfold '+ a b)))

User avatar
Emu*
Posts: 689
Joined: Mon Apr 28, 2008 9:47 am UTC
Location: Cardiff, UK
Contact:

Re: Simplest way to create a GUI?

Postby Emu* » Sun Oct 25, 2009 9:22 pm UTC

It is difficult to use Javascript for a GUI without dealing with the DOM...

I was thinking more of browser inconsistensies, but if you use a library like jQuery you can avoid writing much!
Cosmologicon wrote:Emu* implemented a naive east-first strategy and ran it for an hour, producing results that rivaled many sophisticated strategies, visiting 614 cells. For this, Emu* is awarded Best Deterministic Algorithm!

Unparallelogram
Posts: 336
Joined: Mon Jul 28, 2008 4:16 am UTC

Re: Simplest way to create a GUI?

Postby Unparallelogram » Sun Oct 25, 2009 9:50 pm UTC

NetBeans has a pretty good GUI designer for Swing. It would require you to fill in the logic bits yourself though.

User avatar
Æshættr
Posts: 149
Joined: Mon Jul 30, 2007 4:47 am UTC

Re: Simplest way to create a GUI?

Postby Æshættr » Mon Oct 26, 2009 3:14 am UTC

I second NetBeans. It's basically a Java IDE with a GUI for GUI-building (i.e. you don't need to know much, if any GUI-related code to make it work.) It also has the advantage that it's free.

User avatar
Patman
Posts: 57
Joined: Sat Sep 27, 2008 7:49 am UTC

Re: Simplest way to create a GUI?

Postby Patman » Sat Oct 31, 2009 5:29 am UTC

I'd recommend JavaScript and jQuery for your GUI. JQuery will take care of the shitty DOM issues and is an excellent way to break you in to javascript.

User avatar
Jorpho
Posts: 6291
Joined: Wed Dec 12, 2007 5:31 am UTC
Location: Canada

Re: Simplest way to create a GUI?

Postby Jorpho » Thu Feb 07, 2013 2:05 am UTC

I've been thinking of poking at this again lately – I can see a need for a fresh Windows application in my workplace – but my memories of hacking away at PyGTK are not pleasant ones, plus there's the inconvenience of having to install goodness-knows how many GTK packages on whichever machine it needs to go.

Are there new and better ways for making Windows GUIs with Python lately? Perhaps someone here has tried Iron Python and can comment?

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Simplest way to create a GUI?

Postby EvanED » Thu Feb 07, 2013 2:44 am UTC

Jorpho wrote:I've been thinking of poking at this again lately – I can see a need for a fresh Windows application in my workplace – but my memories of hacking away at PyGTK are not pleasant ones, plus there's the inconvenience of having to install goodness-knows how many GTK packages on whichever machine it needs to go.

Are there new and better ways for making Windows GUIs with Python lately? Perhaps someone here has tried Iron Python and can comment?
I'm not sure if this counts as "new" for you, but I recommend Qt and PyQt/PySide highly.

JOBGG
Posts: 5
Joined: Tue Feb 12, 2013 10:02 pm UTC

Re: Simplest way to create a GUI?

Postby JOBGG » Thu Feb 14, 2013 12:20 am UTC

I think we're all going a little overboard here really. After all, what is asked for is a couple of buttons, some code and a GUI library, with the thing most likely running on a windows machine. Here's what I'd do:

1. Get myself Visual Studio Express. It's free.
2. Find some tutorials on C#, the new boston for example has 200 videos on C#, but I can't post a link to it.
3. Using the instructions in those tutorials, whip up a simple C# gui in the built in GUI editor of Visual Studio.
4. Wire up the buttons to some simple code, and compile it.
5. ???
6. Profit.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Simplest way to create a GUI?

Postby troyp » Thu Feb 14, 2013 12:48 am UTC

There are automatic GUI generators that you can use to easily create GUIs for command line apps very quickly and easily. I've never used one (apart from issuing a few zenity commands from the terminal out of curiosity) - they're probably very basic, but there's no reason they shouldn't work adequately. If you're not interested in actually designing a serious GUI and this is just a placebo for consolephobia, I'd give one of those a try. Examples are the aforementioned zenity for linux and gumbie for jvm.

User avatar
Jorpho
Posts: 6291
Joined: Wed Dec 12, 2007 5:31 am UTC
Location: Canada

Re: Simplest way to create a GUI?

Postby Jorpho » Thu Feb 14, 2013 3:06 am UTC

JOBGG wrote:I think we're all going a little overboard here really. After all, what is asked for is a couple of buttons, some code and a GUI library, with the thing most likely running on a windows machine. Here's what I'd do:

1. Get myself Visual Studio Express. It's free.
2. Find some tutorials on C#, the new boston for example has 200 videos on C#, but I can't post a link to it.
3. Using the instructions in those tutorials, whip up a simple C# gui in the built in GUI editor of Visual Studio.
4. Wire up the buttons to some simple code, and compile it.
5. ???
6. Profit.
I thought I read that Iron Python will let you do pretty much the same thing, but I'm not sure I read that correctly.

User avatar
thoughtfully
Posts: 2253
Joined: Thu Nov 01, 2007 12:25 am UTC
Location: Minneapolis, MN
Contact:

Re: Simplest way to create a GUI?

Postby thoughtfully » Thu Feb 14, 2013 4:46 am UTC

Iron Python runs on the .NET virtual machine, like C# does. I expexct that is insufficient to interface with the GUI generating tools.
Image
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

User avatar
tastelikecoke
Posts: 1208
Joined: Mon Feb 01, 2010 7:58 am UTC
Location: Antipode of Brazil
Contact:

Re: Simplest way to create a GUI?

Postby tastelikecoke » Thu Feb 14, 2013 1:14 pm UTC

I want an answer to this question too. I tried Swing, Tk and .Net, then looked a bit on Gtk. .Net is the cute but it's too microsoft-y. Swing is ugly, Tk is super-ugly, and Gtk looks too big of an API for me (and messed up since I tried it in C.)

If there's any GUI framework out of javascript/<insert dream language here> with a web dev touch in UI designing (XML+CSS) I would happily try it.

User avatar
PM 2Ring
Posts: 3715
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: Simplest way to create a GUI?

Postby PM 2Ring » Fri Feb 15, 2013 4:51 am UTC

GTK is rather large, but you don't need to learn the whole thing. :) Start small, work through the tutorial to learn the basics, and then learn about the more advanced features as (and if) you need them. I will admit that it has some annoying bits, partly due to its origin as a GUI system that sits on X windows.

However, I've only ever used it through Python (PyGTK 2). I don't think I'd enjoy using it so much in C, which is kinda ironic, since I originally chose GTK over Qt, because I wanted a multi-platform, multi-language GUI that didn't require the use of an OOP language (I only know C, not C++ or any of the other OOP members of the C family). And although you don't need OOP to do GTK, it sure makes life simpler; and Python's duck-typing also helps make the experience more pleasant.

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Simplest way to create a GUI?

Postby EvanED » Fri Feb 15, 2013 5:18 am UTC

I'm still going to try to pimp Qt again. I've worked a bit with it in C++ and more in Python (with PyQt), and every time it has been great. I consider it to be one of the best-designed APIs I've used.

I also harbor ill-deserved resentment against GTK from the GTK 1 days when programs written with it looked ugly as sin. :-) (But I can't really compare the APIs as I haven't programmed with GTK.)

User avatar
Link
Posts: 1419
Joined: Sat Mar 07, 2009 11:33 am UTC
Location: ᘝᓄᘈᖉᐣ
Contact:

Re: Simplest way to create a GUI?

Postby Link » Mon Feb 18, 2013 9:49 pm UTC

EvanED wrote:I'm still going to try to pimp Qt again. I've worked a bit with it in C++ and more in Python (with PyQt), and every time it has been great. I consider it to be one of the best-designed APIs I've used.

I also harbor ill-deserved resentment against GTK from the GTK 1 days when programs written with it looked ugly as sin. :-) (But I can't really compare the APIs as I haven't programmed with GTK.)
Seconding that. Qt is very nice and highly portable. The need for a meta-object compiler is a bit annoying, but I can live with that. It's also not usable from C, but if you keep your implementation and interface code separate (as you should be doing anyway), you should still be able to use plain C for everything except for the GUI. The Qt developers usually try to force-feed you QMake, but you if you prefer to use the GNU build system, autotroll can help.

FWIW, GTK is also pretty good, although I prefer Qt.

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Simplest way to create a GUI?

Postby EvanED » Mon Feb 18, 2013 10:55 pm UTC

Link wrote:Seconding that. Qt is very nice and highly portable. The need for a meta-object compiler is a bit annoying, but I can live with that. It's also not usable from C, but if you keep your implementation and interface code separate (as you should be doing anyway), you should still be able to use plain C for everything except for the GUI. The Qt developers usually try to force-feed you QMake, but you if you prefer to use the GNU build system, autotroll can help.
With the downside that then you're using autotools, and QMake is more portable. (In particular, it can create projects buildable by the MSVS compiler, while AFAIK autotools cannot.)

And yes, QMake and particularly MOC, because they're not really standard, are relatively small drawbacks to using Qt with C++. However, it doesn't really affect the use in Python if you want to go that route. :-)

walkietokyo
Posts: 3
Joined: Sun Jun 26, 2011 2:32 pm UTC

Re: Simplest way to create a GUI?

Postby walkietokyo » Sat Feb 23, 2013 3:58 pm UTC

Another simple way of throwing together a quick GUI is using Adobe FLEX. Its main advantage is its portability in that you can compile your apps for the web as well as for PC's (Windows, Mac, Linux) and for Android and iOS devices.

FLEX is basically a markup language to be able to quickly create a GUI for ActionScript. If you've ever used HTML and JavaScript, you should be able to easily grasp the concept of it.
It's free, open-source, and there's free (as well as paid) development tools for it. A notable example is FDT which has a free version.

Possibly the main drawback is that Flash on the web is on its way out for many applications (such as ads and websites), however it is still really useful for RIA developments.

User avatar
Jplus
Posts: 1721
Joined: Wed Apr 21, 2010 12:29 pm UTC
Location: Netherlands

Re: Simplest way to create a GUI?

Postby Jplus » Tue Mar 19, 2013 6:31 pm UTC

Really simple stuff like "push a button and get an answer" can be done entirely in Javascript and HTML, with not serverside backend whatsoever. I can't think of anything easier than that.
"There are only two hard problems in computer science: cache coherence, naming things, and off-by-one errors." (Phil Karlton and Leon Bambrick)

coding and xkcd combined

(Julian/Julian's)


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 8 guests