Mercurial > dwindows
diff dwtest.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 | d4c874f13e9b |
children | 896347a9be19 |
line wrap: on
line diff
--- a/dwtest.c Wed Nov 16 20:31:35 2011 +0000 +++ b/dwtest.c Fri Nov 18 13:34:36 2011 +0000 @@ -1655,11 +1655,19 @@ dw_notebook_page_set_text( notebook, notebookpage7, "html"); rawhtml = dw_html_new(1001); - dw_box_pack_start( notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0); - dw_html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>"); - html = dw_html_new(1002); - dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0); - dw_html_url(html, "http://dwindows.netlabs.org"); + if(rawhtml) + { + dw_box_pack_start( notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0); + dw_html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>"); + html = dw_html_new(1002); + dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0); + dw_html_url(html, "http://dwindows.netlabs.org"); + } + else + { + html = dw_text_new("HTML widget not available.", 0); + dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0); + } notebookbox8 = dw_box_new( BOXVERT, 7 ); notebookpage8 = dw_notebook_page_new( notebook, 1, FALSE );