[gtk+/wip/baedert/gtkimageview: 88/156] 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: 88/156] demo: Add some error handling for async operations
- Date: Fri, 26 Feb 2016 17:24:25 +0000 (UTC)
commit 015ff7b71c9fb5b2ceabd23fc3e5e24708453ebf
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]