changeset 627:77cc62375fee

Fixed dw_html_raw() under GTK+ and added test case for it
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 12 Apr 2008 11:01:29 +0000
parents ad7a4335f1f1
children 7d93356f250a
files dwtest.c gtk/dw.c
diffstat 2 files changed, 21 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/dwtest.c	Sat Apr 12 06:48:38 2008 +0000
+++ b/dwtest.c	Sat Apr 12 11:01:29 2008 +0000
@@ -99,6 +99,7 @@
    combobox1,
    combobox2,
    spinbutton,
+   slider,
    notebookbox,
    notebookbox1,
    notebookbox2,
@@ -108,6 +109,7 @@
    notebookbox6,
    notebookbox7,
    html,
+   rawhtml,
    notebook,
    vscrollbar,
    hscrollbar,
@@ -513,6 +515,12 @@
    dw_messagebox("DWTest", DW_MB_OK, "New value from spinbutton: %d\n", value);
 }
 
+/* Callback to handle user selection of the slider position */
+void DWSIGNAL slider_valuechanged_callback(HWND hwnd, int value, void *data)
+{
+   dw_messagebox("DWTest", DW_MB_OK, "New value from slider: %d\n", value);
+}
+
 /* Handle size change of the main render window */
 int DWSIGNAL configure_event(HWND hwnd, int width, int height, void *data)
 {
@@ -968,12 +976,16 @@
       free(text[i]);
    }
    free(text);
-/* make a spinbutton */
+   /* make a spinbutton */
    spinbutton = dw_spinbutton_new( "", 0 ); /* no point in specifying text */
    dw_box_pack_start( combox, spinbutton, 200, 20, TRUE, FALSE, 0);
    dw_spinbutton_set_limits( spinbutton, 100, 1 );
    dw_spinbutton_set_pos( spinbutton, 30 );
    dw_signal_connect( spinbutton, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(spinbutton_valuechanged_callback), NULL );
+   /* make a slider */
+   slider = dw_slider_new( FALSE, 10, 0 ); /* no point in specifying text */
+   dw_box_pack_start( combox, slider, 200, 20, TRUE, FALSE, 0);
+   dw_signal_connect( slider, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(slider_valuechanged_callback), NULL );
 }
 
 void create_button( int redraw)
@@ -1140,8 +1152,12 @@
    notebookpage7 = dw_notebook_page_new( notebook, 1, FALSE );
    dw_notebook_pack( notebook, notebookpage7, notebookbox7 );
    dw_notebook_page_set_text( notebook, notebookpage7, "html");
-   html = dw_html_new(1001);
-   dw_box_pack_start( notebookbox7, html, 100, 100, TRUE, TRUE, 0);
+
+   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);
    /*
     * This originally had:
       dw_html_url(html, "http://dwindows.netlabs.org");
--- a/gtk/dw.c	Sat Apr 12 06:48:38 2008 +0000
+++ b/gtk/dw.c	Sat Apr 12 11:01:29 2008 +0000
@@ -10541,7 +10541,8 @@
       return -1;
 
    DW_MUTEX_LOCK;
-   _gtk_moz_embed_render_data(GTK_MOZ_EMBED(handle), string, strlen(string), "", "");
+   _gtk_moz_embed_render_data(GTK_MOZ_EMBED(handle), string, strlen(string), "file:///", "text/html");
+   gtk_widget_show(GTK_WIDGET(handle));
    DW_MUTEX_UNLOCK;
    return 0;
 #endif