gjs and Gdk.cairo_create()
- From: "Youry Harchenko" <youry ukr net>
- To: javascript-list gnome org
- Subject: gjs and Gdk.cairo_create()
- Date: Fri, 13 Aug 2010 01:28:00 +0300
Hello!
There is gjs-script:
const Gtk = imports.gi.Gtk;
const Gdk = imports.gi.Gdk;
function draw(obj, event) {
let cr = Gdk.cairo_create(obj.window);
}
Gtk.init(null, null);
let win = new Gtk.Window({type: Gtk.WindowType.TOPLEVEL, title: "Test"});
win.connect("destroy", Gtk.main_quit);
let da = new Gtk.DrawingArea();
da.connect("expose_event", draw);
win.add(da);
win.show_all();
Gtk.main();
Here is the result of the script
:
JS ERROR: !!! Exception was: Error: No exception was set, but object construction failed somehow
JS ERROR: !!! lineNumber = '0'
JS ERROR: !!! fileName = 'gjs_throw'
JS ERROR: !!! message = 'No exception was set, but object construction failed somehow'
JS ERROR: !!! stack = 'Error("No exception was set, but object construction failed somehow")@:0
("No exception was set, but object construction failed somehow")@gjs_throw:0
@:0
draw([object _private_Gtk_DrawingArea],[object _private_Gdk_Event])@test.js:5
Error("Chained exception")@:0
("Chained exception")@gjs_throw:0
'
What is the reason?
I used:
Linux Mandriva 2010.1 x86-64
gjs 0.6
gobject-introspection 0.6.10
gir-repository 0.6.5
gtk 2.20.1
cairo 1.9.6
With best regards, Youry Harchenko
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]