[Bug 640] MokoScrolledPane not able to scroll a gtkhtml Widget

bugzilla-daemon at bugzilla.openmoko.org bugzilla-daemon at bugzilla.openmoko.org
Mon Jul 16 23:08:36 CEST 2007


http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=640





------- Additional Comments From J.Schauer at web.de  2007-07-16 23:08 -------
Here is the code to reproduce this bug:

//create the document
HtmlDocument *document = html_document_new();

html_document_clear(document);
html_document_open_stream(document, "text/html");
html_document_write_stream(document, "", strlen(""));
html_document_close_stream(document);

//create the gtkhtml widget and supply the document to it
GtkWidget *view = html_view_new();
html_view_set_document( HTML_VIEW(view), document );

//delete this line to let the scrollbar disappear
gtk_widget_set_size_request(view, -1, 1000);

//use MokoScrolledPane to display the widget
MokoScrolledPane* detailswindow = moko_scrolled_pane_new();
moko_scrolled_pane_pack_with_viewport (MOKO_SCROLLED_PANE (detailswindow),
GTK_WIDGET(view) );

Just Insert some test html in html_document_write_stream. If you uncomment
gtk_widget_set_size_request it will no longer be scrollable.
As said before I also tried to pack the widget in different containers with no luck.

Here is the same code but without the use of MokoScrolledPane:

//create the document
HtmlDocument *document = html_document_new();

html_document_clear(document);
html_document_open_stream(document, "text/html");
html_document_write_stream(document, "", strlen(""));
html_document_close_stream(document);

//create the gtkhtml widget and supply the document to it
GtkWidget *view = html_view_new();
html_view_set_document( HTML_VIEW(view), document );

//use gtk_scrolled_window to display the widget
GtkWidget *scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
                                        GTK_POLICY_AUTOMATIC, TK_POLICY_ALWAYS);
gtk_container_add(GTK_CONTAINER(scrolledwindow), view);

And this works! I only changed the last two lines and replaced them with the gtk
widgets instead of the moko widgets.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
You are on the CC list for the bug, or are watching someone who is.




More information about the buglog mailing list