17

I want to make a simple GUI Application. Can anybody give me source code of a simple GUI Application? So far, I have been competing in Programming Competitions (I have been using C++ for it) and now I want to get started with Application Development.

1
  • 6
    Remember you can also use apt-get source package-name to get the source code of existing applications in the repositories. Or checkout the repositories at some online services, like Launchpad and Github. Apr 14, 2013 at 3:18

2 Answers 2

21

To make simple applications in Ubuntu, you'd possibly want to look at the Ubuntu App Developer API.

On this website, you'll find a plethora of resources for application development on Ubuntu and you'll see that, under "Programming languages" your knowledge of C++ will be well placed.

If you must see source code, there are some examples under the Ubuntu App Developer Cookbook as well as external links. This link has been removed as it is outdated.

Finally, you may also want to check out Qt for further reading.

Good luck!

04/01/2015 EDIT:

Since this post first went up in 2013, with new versions of Ubuntu being pushed to stable, it seems the above is now outdated.

To make some simple applications (GUI or not), try the Ubuntu SDK. The Ubuntu SDK is based on Qt Creator, hence all simple GUI applications should probably go through this now.

0
0

For a simple application, there's always TCL/TK. Probably TCL is installed by default, so get tk:

sudo apt-get update
sudo apt-get install tk

That gives you wish, the interpreter too, so things like a 25 button array, each button starting a clock with a slightly different background color takes only 11 lines:

#!/usr/bin/wish
wm title . "Buttons and Clocks"
array set bgr "1 blue 2 red  4 yellow 5 purple 3 green"
foreach col [lsort [array names bgr]] {
  pack [frame .f$col] -side left
  foreach  row {1 2 3 4 5} {
    set rr [expr $row * 3 ]
    set cc [expr 10 - 2 * $col ]
    set cmd [list "Button $row$col creates a $bgr($col) xclock."]
    pack [ button .f$col.$col$row -text "r${row}c$col" -background $bgr($col) \
         -command "puts stdout $cmd; exec xclock -bg rgb:${rr}/${col}/$cc &"] }}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .