Re[2]: gjs and Gdk.cairo_create()



Hello!

Thanks for your reply.

New text (with
const Cairo = imports.cairo ):

const Cairo = imports.cairo;
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();


Result is the same

    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:6
Error("Chained exception")@:0
("Chained exception")@gjs_throw:0
'

I did not compile packages. I used Mandriva's repository.

With best regards, Youry Harchenko.


--- Оригінальне повідомлення ---
Від кого: Johan Dahlin <johan gnome org>
Кому: Youry Harchenko <youry ukr net>
Дата: 13 серпня, 02:51:12
Тема: Re: gjs and Gdk.cairo_create()

2010/8/12 Youry Harchenko <youry ukr net>:
> 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);
> }
>
[..]
> 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?

Did you compile gjs with cairo support?
As a way of debugging, try adding let cairo = imports.cairo; before
importing Gtk and see if anything
changes.

--
Johan Dahlin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]