+// local code (see below)
+//-----------------------------------------------------------------------------
+
+static void draw_frame( GtkWidget *widget, wxWindow *win )
+{
+ if (!win->m_hasVMT)
+ return;
+
+ int dw = 0;
+ int dh = 0;
+
+ if (win->HasScrolling())
+ {
+ GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(widget);
+ GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(widget)->klass );
+
+/*
+ GtkWidget *hscrollbar = scroll_window->hscrollbar;
+ GtkWidget *vscrollbar = scroll_window->vscrollbar;
+
+ we use this instead: range.slider_width = 11 + 2*2pts edge
+*/
+
+ if (scroll_window->vscrollbar_visible)
+ {
+ dw += 15; /* dw += vscrollbar->allocation.width; */
+ dw += scroll_class->scrollbar_spacing;
+ }
+
+ if (scroll_window->hscrollbar_visible)
+ {
+ dh += 15; /* dh += hscrollbar->allocation.height; */
+ dh += scroll_class->scrollbar_spacing;
+ }
+ }
+
+ int dx = 0;
+ int dy = 0;
+ if (GTK_WIDGET_NO_WINDOW (widget))
+ {
+ dx += widget->allocation.x;
+ dy += widget->allocation.y;
+ }
+
+ if (win->HasFlag(wxRAISED_BORDER))
+ {
+ gtk_draw_shadow( widget->style,
+ widget->window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_OUT,
+ dx, dy,
+ win->m_width-dw, win->m_height-dh );
+ return;
+ }
+
+ if (win->HasFlag(wxSUNKEN_BORDER))
+ {
+ gtk_draw_shadow( widget->style,
+ widget->window,
+ GTK_STATE_NORMAL,
+ GTK_SHADOW_IN,
+ dx, dy,
+ win->m_width-dw, win->m_height-dh );
+ return;
+ }
+
+ if (win->HasFlag(wxSIMPLE_BORDER))
+ {
+ GdkGC *gc;
+ gc = gdk_gc_new( widget->window );
+ gdk_gc_set_foreground( gc, &widget->style->black );
+ gdk_draw_rectangle( widget->window, gc, FALSE,
+ dx, dy,
+ win->m_width-dw-1, win->m_height-dh-1 );
+ gdk_gc_unref( gc );
+ return;
+ }
+}
+
+//-----------------------------------------------------------------------------
+// "expose_event" of m_widget
+//-----------------------------------------------------------------------------
+
+static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxWindow *win )
+{
+ if (gdk_event->count > 0) return;
+ draw_frame( widget, win );
+}
+
+//-----------------------------------------------------------------------------
+// "draw" of m_widget
+//-----------------------------------------------------------------------------
+
+static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxWindow *win )
+{
+ draw_frame( widget, win );
+}
+
+//-----------------------------------------------------------------------------
+// key code mapping routines