wscroll = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT (vadj));
-#if !defined HAVE_PGTK && GTK_CHECK_VERSION (2, 18, 0)
- eassert (gdk_window_ensure_native (gtk_widget_get_window (wscroll)));
-#endif
-
xg_finish_scroll_bar_creation (f, wscroll, bar, scroll_callback,
end_callback, scroll_bar_name);
bar->horizontal = 0;
wscroll = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (hadj));
-#if !defined HAVE_PGTK && GTK_CHECK_VERSION (2, 18, 0)
- eassert (gdk_window_ensure_native (gtk_widget_get_window (wscroll)));
-#endif
-
xg_finish_scroll_bar_creation (f, wscroll, bar, scroll_callback,
end_callback, scroll_bar_name);
bar->horizontal = 1;
gtk_widget_show_all (wparent);
gtk_widget_set_size_request (wscroll, width, height);
}
+
+#if !defined HAVE_PGTK && GTK_CHECK_VERSION (2, 18, 0)
+ if (!gdk_window_ensure_native (gtk_widget_get_window (wscroll)))
+ emacs_abort ();
+#endif
+
if (oldx != -1 && oldw > 0 && oldh > 0)
{
/* Clear under old scroll bar position. */
int width,
int height)
{
-
GtkWidget *wscroll = xg_get_widget_from_map (scrollbar_id);
if (wscroll)
pgtk_clear_area (f, oldx, oldy, oldw, oldh);
#endif
+#if !defined HAVE_PGTK && GTK_CHECK_VERSION (2, 18, 0)
+ if (!gdk_window_ensure_native (gtk_widget_get_window (wscroll)))
+ emacs_abort ();
+#endif
+
/* GTK does not redraw until the main loop is entered again, but
if there are no X events pending we will not enter it. So we sync
here to get some events. */