5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 19:50:15 +08:00

add function argument to ExecuteOnMainThread

This commit is contained in:
Travis McLane 2022-01-19 13:36:44 -06:00
parent b11964f0eb
commit 3bcddd5b4c

View File

@ -196,8 +196,8 @@ int executeJS(gpointer data) {
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
void ExecuteOnMainThread(JSCallback* jscallback) { void ExecuteOnMainThread(void* f, JSCallback* jscallback) {
g_idle_add((GSourceFunc)executeJS, (gpointer)jscallback); g_idle_add((GSourceFunc)f, (gpointer)jscallback);
} }
void extern processOpenFileResult(char*); void extern processOpenFileResult(char*);
@ -443,7 +443,7 @@ func (w *Window) ExecJS(js string) {
webview: w.webview, webview: w.webview,
script: C.CString(js), script: C.CString(js),
} }
C.ExecuteOnMainThread(&jscallback) C.ExecuteOnMainThread(C.executeJS, &jscallback)
} }
func (w *Window) StartDrag() { func (w *Window) StartDrag() {