Skip to content

Commit

Permalink
Small updates of samples
Browse files Browse the repository at this point in the history
  • Loading branch information
pavouk committed Nov 3, 2011
1 parent 4960d87 commit 3132434
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 66 deletions.
Empty file modified samples/clutterdemo.lua 100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion samples/gtkclipboard.lua
Expand Up @@ -4,7 +4,7 @@
-- http://live.gnome.org/Vala/GTKSample#Clipboard

local lgi = require 'lgi'
local Gtk = lgi.Gtk
local Gtk = lgi.require('Gtk', '3.0')
local Gdk = lgi.Gdk

local app = Gtk.Application { application_id = 'org.lgi.samples.gtkclipboard' }
Expand Down
4 changes: 2 additions & 2 deletions samples/gtkconsole.lua
Expand Up @@ -7,8 +7,8 @@
--

local lgi = require 'lgi'
local Gtk = lgi.Gtk
local Vte = lgi.Vte
local Gtk = lgi.require('Gtk', '3.0')
local Vte = lgi.require('Vte', '2.90')

-- Simple readline implementation with asynchronous interface.
local ReadLine = {}
Expand Down
55 changes: 0 additions & 55 deletions samples/gtklistview.lua

This file was deleted.

16 changes: 8 additions & 8 deletions samples/gtkpad.lua
Expand Up @@ -11,16 +11,19 @@
--]]--------------------------------------------------------------------------
local lgi = require 'lgi'
local Gtk = lgi.Gtk
local Gtk = lgi.require('Gtk', '3.0')
local Gio = lgi.Gio
local function new_editor(app, file)
local app = Gtk.Application.new('org.lgi.GtkPad',
Gio.ApplicationFlags.HANDLES_OPEN)
function app:new_editor(file)
local contents = file and file:load_contents()
local window = Gtk.Window {
type = Gtk.WindowType.TOPLEVEL,
default_width = 400,
default_height = 300,
application = app,
application = self,
title = file and file:get_parse_name() or '<Untitled>',
child = Gtk.ScrolledWindow {
child = Gtk.TextView {
Expand All @@ -34,15 +37,12 @@ local function new_editor(app, file)
return window
end
local app = Gtk.Application.new('org.lgi.GtkPad',
Gio.ApplicationFlags.HANDLES_OPEN)
function app:on_activate()
new_editor(self)
self:new_editor()
end
function app:on_open(files)
for i = 1, #files do new_editor(self, files[i]) end
for i = 1, #files do self:new_editor(files[i]) end
end
return app:run {arg[0], ...}

0 comments on commit 3132434

Please sign in to comment.