You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Uncaught TypeError: Unsupported type: function #53
error: Uncaught TypeError: Unsupported type: function
throw new TypeError(`Unsupported type: ${typeof v}`);
^
at Function.from (https://deno.land/x/python@0.4.1/src/python.ts:533:15)
at PyObject.call (https://deno.land/x/python@0.4.1/src/python.ts:760:57)
at Proxy.object (https://deno.land/x/python@0.4.1/src/python.ts:258:20)
at file:///home/mrcool/dev/deno/lab/a.ts:13:5
import{NamedArgument,python}from"https://deno.land/x/python@0.4.1/mod.ts";constgi=python.import("gi");gi.require_version("Gtk","4.0");gi.require_version("Adw","1");constGtk=python.import("gi.repository.Gtk");constAdw=python.import("gi.repository.Adw");classMainWindowextendsGtk.ApplicationWindow{constructor(kwargs){super(kwargs);// question about this partconstbutton=Gtk.Button(newNamedArgument("label","Hello"));this.set_child(button);}}classMyAppextendsAdw.Application{// deno-lint-ignore constructor-superconstructor(...kwargs: any){super().__init__(kwargs);this.connect("activate",this.onActivate);}onActivate=python.callback((kwargs, ...args)=>{constapp=args[0];constwin=newMainWindow(newNamedArgument("application",app));win.present();});}constapp=newMyApp(newNamedArgument("application_id","com.example.com"));app.run(Deno.args);
There are porbably other issues, but the immediate one I have is
Activity
DjDeveloperr commentedon Nov 6, 2023
Here's an example for passing JS functions to Python land:
deno_python/test/test.ts
Line 283 in 025e9da
sigmaSd commentedon Nov 7, 2023
Nice this works indeed
sigmaSd commentedon Nov 7, 2023
@DjDeveloperr I'm following this tutorial https://github.com/Taiko2k/GTK4PythonTutorial and this is what I reached so far
There are porbably other issues, but the immediate one I have is
if I change
const button =tothis.button =I get an error