comparison 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
comparison
equal deleted inserted replaced
1353:f4ad4ba39b61 1354:1f22addc2722
1653 notebookpage7 = dw_notebook_page_new( notebook, 1, FALSE ); 1653 notebookpage7 = dw_notebook_page_new( notebook, 1, FALSE );
1654 dw_notebook_pack( notebook, notebookpage7, notebookbox7 ); 1654 dw_notebook_pack( notebook, notebookpage7, notebookbox7 );
1655 dw_notebook_page_set_text( notebook, notebookpage7, "html"); 1655 dw_notebook_page_set_text( notebook, notebookpage7, "html");
1656 1656
1657 rawhtml = dw_html_new(1001); 1657 rawhtml = dw_html_new(1001);
1658 dw_box_pack_start( notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0); 1658 if(rawhtml)
1659 dw_html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>"); 1659 {
1660 html = dw_html_new(1002); 1660 dw_box_pack_start( notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0);
1661 dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0); 1661 dw_html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>");
1662 dw_html_url(html, "http://dwindows.netlabs.org"); 1662 html = dw_html_new(1002);
1663 dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0);
1664 dw_html_url(html, "http://dwindows.netlabs.org");
1665 }
1666 else
1667 {
1668 html = dw_text_new("HTML widget not available.", 0);
1669 dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0);
1670 }
1663 1671
1664 notebookbox8 = dw_box_new( BOXVERT, 7 ); 1672 notebookbox8 = dw_box_new( BOXVERT, 7 );
1665 notebookpage8 = dw_notebook_page_new( notebook, 1, FALSE ); 1673 notebookpage8 = dw_notebook_page_new( notebook, 1, FALSE );
1666 dw_notebook_pack( notebook, notebookpage8, notebookbox8 ); 1674 dw_notebook_pack( notebook, notebookpage8, notebookbox8 );
1667 dw_notebook_page_set_text( notebook, notebookpage8, "scrollbox"); 1675 dw_notebook_page_set_text( notebook, notebookpage8, "scrollbox");