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

« back to all changes in this revision

Viewing changes to examples/gtkhtml.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:
1
 
#! /usr/bin/env lua
2
 
require "gtk"
3
 
 
4
 
 
5
 
function build_gui()
6
 
    w = gtk.window_new(gtk.GTK_WINDOW_TOPLEVEL)
7
 
    w:connect('destroy', gtk.main_quit)
8
 
    w:set_title('GtkHTML Demo')
9
 
 
10
 
    -- create a HtmlDocument
11
 
    doc = gtk.html_document_new()
12
 
    doc:open_stream("text/html")
13
 
    s = "<html><body><p>Hello, World!</p></body></html>"
14
 
    doc:write_stream(s, #s)
15
 
    doc:close_stream()
16
 
 
17
 
    -- create a HtmlView and set the document; note that it segfaults
18
 
    -- if no document is set and the mouse leaves the widget.
19
 
    view = gtk.html_view_new()
20
 
    view:set_document(doc)
21
 
 
22
 
    w:add(view)
23
 
 
24
 
    w:show_all()
25
 
end
26
 
 
27
 
 
28
 
build_gui()
29
 
gtk.main()
30