X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/20239453d57b635b6e578c4e46ef02b198512733..d9f39e09e82e99c422619f4e3df536d0a9e87987:/utils/glcanvas/gtk/glcanvas.cpp diff --git a/utils/glcanvas/gtk/glcanvas.cpp b/utils/glcanvas/gtk/glcanvas.cpp index 47a21717e9..74b442c096 100644 --- a/utils/glcanvas/gtk/glcanvas.cpp +++ b/utils/glcanvas/gtk/glcanvas.cpp @@ -214,6 +214,8 @@ bool wxGLCanvas::Create( wxWindow *parent, wxWindowID id, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK ); + GTK_WIDGET_SET_FLAGS( m_glWidget, GTK_CAN_FOCUS ); + gtk_widget_pop_visual(); gtk_widget_pop_colormap(); @@ -227,6 +229,9 @@ bool wxGLCanvas::Create( wxWindow *parent, wxWindowID id, gtk_signal_connect( GTK_OBJECT(m_glWidget), "draw", GTK_SIGNAL_FUNC(gtk_window_draw_callback), (gpointer)this ); + /* connect to key press and mouse handlers etc. */ + ConnectWidget( m_glWidget ); + gtk_widget_show( m_glWidget ); m_glContext = new wxGLContext( TRUE, this, palette ); @@ -273,7 +278,7 @@ void wxGLCanvas::SetColour( const char *colour ) if (m_glContext) m_glContext->SetColour( colour ); } -void wxGLCanvas::SetSize( int x, int y, int width, int height, int sizeFlags ) +void wxGLCanvas::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { if (m_resizing) return; // I don't like recursions m_resizing = TRUE; @@ -321,8 +326,7 @@ void wxGLCanvas::SetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth; if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; - wxPoint pt( m_parent->GetClientAreaOrigin() ); - gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y ); + gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x, m_y ); if ((old_width != m_width) || (old_height != m_height)) { @@ -348,11 +352,6 @@ void wxGLCanvas::SetSize( int x, int y, int width, int height, int sizeFlags ) m_resizing = FALSE; } -void wxGLCanvas::SetSize( int width, int height ) -{ - SetSize( -1, -1, width, height, wxSIZE_USE_EXISTING ); -} - GtkWidget *wxGLCanvas::GetConnectWidget() { return m_glWidget;