ADG Lua 

ADG Lua Commit Details

Date:2013-03-25 12:42:56 (6 years 4 months ago)
Author:Nicola Fontana
Branch:master
Commit:a4011520a163ea8cae357be5e1c1c2837af4b4e2
Parents: 523e343445f22867e18845a3155a9a3c3f63f279
Message:adg-demo: added custom error handling

Changes:
Madg-demo.lua.in (3 diffs)

File differences

adg-demo.lua.in
7373
7474
7575
76
77
78
79
80
81
82
83
84
85
86
87
88
89
7690
7791
7892
......
237251
238252
239253
240
254
255
241256
242257
243258
......
286301
287302
288303
304
305
289306
290307
291308
Adg.gtk_use_default_icons(adg_data_dir)
-- Customize error handler
error = function (message)
local dialog = Gtk.MessageDialog {
dialog_flags = Gtk.DialogFlags.DESTROY_WITH_PARENT,
message_type = Gtk.MessageType.ERROR,
buttons = Gtk.Buttons.CLOSE,
text = message,
title = 'Error from adg-demo',
}
dialog:run()
end
-- GtkBuilder initialization
local builder = Gtk.Builder()
if not GLib.str_has_suffix(file, suffix) then
file = file .. suffix
end
canvas:export(file)
_, err = canvas:export(file)
if err then error(err) end
end
dialog:hide()
end
local result, err = operation:run(Gtk.PrintOperationAction.PRINT_DIALOG, ui.wndMain)
if result == Gtk.PrintOperationResult.APPLY then
settings = operation:get_print_settings()
elseif err then
error(err)
end
end

Archive Download the corresponding diff file

Branches

Tags