diff gtk3/dw.c @ 1354:1f22addc2722

Changed the behavior of dw_html_new() to return NULL on failure like the documentation indicates... Instead of creating a text widget with an error message. This error message is now sent to the console. This allows programs to be able to gracefully handle the failure to create the HTML widget. Also updated the dwtest program to create a text widget in a similar fashion on failure. Also updated the dw_calendar_* comments to no longer be unsupported on OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 18 Nov 2011 13:34:36 +0000
parents f4ad4ba39b61
children dd252596227b
line wrap: on
line diff
--- a/gtk3/dw.c	Wed Nov 16 20:31:35 2011 +0000
+++ b/gtk3/dw.c	Fri Nov 18 13:34:36 2011 +0000
@@ -10129,16 +10129,14 @@
  */
 HWND dw_html_new(unsigned long id)
 {
-   GtkWidget *widget,*stext;
+   GtkWidget *widget = NULL,*stext;
    int _locked_by_me = FALSE;
 
    DW_MUTEX_LOCK;
 #ifdef USE_WEBKIT
    if (!_webkit_web_view_open)
    {
-      widget = dw_box_new(DW_HORZ, 0);
-      stext = dw_text_new( "HTML widget not available; you do not have access to webkit.", 0);
-      dw_box_pack_start(widget, stext, 0, 0, TRUE, TRUE, 10);
+      dw_debug( "HTML widget not available; you do not have access to webkit." );
    }
    else
    {
@@ -10152,12 +10150,10 @@
       g_object_set_data(G_OBJECT(widget), "_dw_web_view", (gpointer)web_view);
       g_signal_connect( web_view, "populate-popup", G_CALLBACK(_dw_html_populate_popup_cb), NULL );
    }
+   gtk_widget_show(widget);
 #else
-   widget = dw_box_new(DW_HORZ, 0);
-   stext = dw_text_new( "HTML widget not available; you do not have access to webkit.", 0);
-   dw_box_pack_start(widget, stext, 0, 0, TRUE, TRUE, 10);
+   dw_debug( "HTML widget not available; you do not have access to webkit." );
 #endif
-   gtk_widget_show(widget);
    DW_MUTEX_UNLOCK;
    return widget;
 }