[gtk+/wip/baedert/gtkimageview: 171/255] demo: Add some error handling for async operations
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/gtkimageview: 171/255] demo: Add some error handling for async operations
- Date: Thu, 12 May 2016 17:32:18 +0000 (UTC)
commit 920852a0c21995088d096e19ef3d1157760a5c97
Author: Timm Bäder <mail baedert org>
Date: Fri Jan 22 17:39:27 2016 +0100
demo: Add some error handling for async operations
demos/gtk-demo/image_view.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/demos/gtk-demo/image_view.c b/demos/gtk-demo/image_view.c
index 425c307..73de799 100644
--- a/demos/gtk-demo/image_view.c
+++ b/demos/gtk-demo/image_view.c
@@ -25,6 +25,26 @@ file_set_cb (GtkFileChooserButton *widget,
NULL);
}
+
+static void
+image_loaded_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
+{
+ GtkImageView *image_view = GTK_IMAGE_VIEW (source_object);
+ GError *error = NULL;
+
+ gtk_image_view_load_from_file_finish (image_view,
+ result,
+ &error);
+
+ if (error)
+ {
+ g_message ("Error: %s", error->message);
+ return;
+ }
+}
+
void
load_button_cb ()
{
@@ -34,7 +54,7 @@ load_button_cb ()
file,
1,
NULL,
- generic_cb,
+ image_loaded_cb,
NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]