[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sun, 20 Mar 2022 04:55:03 -0400 (EDT) |
branch: master
commit 874bf19fd7ea0e48884f346467b691b4c174c607
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat May 11 21:13:53 2019 +0100
return value from event handler
---
js/wkinfo/main.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/js/wkinfo/main.c b/js/wkinfo/main.c
index 6f5b7bc6d2..0e5dc56a0d 100644
--- a/js/wkinfo/main.c
+++ b/js/wkinfo/main.c
@@ -181,7 +181,11 @@ hide_index_cb (GtkWidget *widget,
return TRUE;
}
-int main(int argc, char* argv[])
+
+static GMainLoop *main_loop;
+
+int
+main(int argc, char* argv[])
{
gtk_init(&argc, &argv);
@@ -198,9 +202,6 @@ int main(int argc, char* argv[])
WebKitSettings *settings = webkit_web_view_group_get_settings (group);
webkit_settings_set_enable_javascript (settings, FALSE);
- webkit_web_context_get_default ();
-
-
/* Load "extensions". The web browser is run in a separate process
and we can only access the DOM in that process. */
g_signal_connect (webkit_web_context_get_default (),
@@ -259,7 +260,8 @@ int main(int argc, char* argv[])
"file:/home/g/src/texinfo/GIT/js/test/hello/index.html");
//"file:/home/g/src/texinfo/GIT/js/wkinfo/test.html");
- gtk_main ();
+ main_loop = g_main_loop_new (NULL, FALSE);
+ g_main_loop_run (main_loop);
return 0;
}
@@ -272,12 +274,12 @@ onkeypress (GtkWidget *webView,
GdkEventKey *k = (GdkEventKey *) event;
if (k->type != GDK_KEY_PRESS)
- return FALSE;
+ return TRUE;
switch (k->keyval)
{
case GDK_KEY_q:
- gtk_main_quit();
+ g_main_loop_quit (main_loop);
break;
case GDK_KEY_n:
webkit_web_view_load_uri (WEBKIT_WEB_VIEW(webView),
@@ -292,21 +294,21 @@ onkeypress (GtkWidget *webView,
up_link);
break;
case GDK_KEY_i:
- g_print ("foobar\n");
show_index ();
break;
default:
- ;
+ return FALSE;
}
- return FALSE;
+ return TRUE;
+
}
static void
destroyWindowCb (GtkWidget *widget, GtkWidget *window)
{
- gtk_main_quit ();
+ g_main_loop_quit (main_loop);
}
static gboolean
- [no subject], (continued)
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject],
Gavin D. Smith <=
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20
- [no subject], Gavin D. Smith, 2022/03/20