~ubuntu-branches/ubuntu/natty/lua-gtk/natty

« back to all changes in this revision

Viewing changes to examples/dialog.lua

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Tassi
  • Date: 2009-05-17 18:16:21 UTC
  • mfrom: (1.2.1 upstream) (4.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20090517181621-9kmdd82nxg54jsio
* new upstream snapshot comprising many more GNOME libraries:
    Gtk, GDK, GLib, Pango, Atk, Libxml2, Cairo, Clutter, Gtkhtml, 
    GtkSourceView, Gio, Gtkspell and GConf. 
* new upstream release includes a new configure script written in Lua,
  no more bashisms there (Closes: #507205)
* renamed binary packages to liblua5.1-gnome-*
* updated standards-version to 3.8.1, no changes needed
* patch to load .so.* version of libraries and not .so (that was requiring
  -dev packages) (Closes: #522087)
* removed redundant Architecture line from the source stanza of control
  (Closes: #498120)
* updated copyright file, Wolfgang Oertl holds it for 2009 too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
require "gtk"
5
5
 
6
6
dialog = gtk.dialog_new_with_buttons ("Message", nil,
7
 
        gtk.GTK_DIALOG_DESTROY_WITH_PARENT,
8
 
        gtk.GTK_STOCK_OK, gtk.GTK_RESPONSE_ACCEPT,
9
 
        gtk.GTK_STOCK_CANCEL, gtk.GTK_RESPONSE_CANCEL,
 
7
        gtk.DIALOG_DESTROY_WITH_PARENT,
 
8
        gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
 
9
        gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
10
10
        nil)
11
11
entry = gtk.entry_new()
12
12
entry:set_alignment(0.9)
13
13
 
14
14
--  Add the label, and show everything we've added to the dialog.
15
15
dialog.vbox:add(entry)
16
 
dialog:set_default_response(gtk.GTK_RESPONSE_ACCEPT)
 
16
dialog:set_default_response(gtk.RESPONSE_ACCEPT)
17
17
dialog:show_all()
18
18
 
19
19
-- Run the dialog, print the response.
20
20
rc = dialog:run()
21
 
print(rc, rc == gtk.GTK_RESPONSE_ACCEPT:tonumber() and entry:get_text() or "")
 
21
print(rc, rc == gtk.RESPONSE_ACCEPT:tonumber() and entry:get_text() or "")
22
22
dialog:destroy()
23
23