void OnCloseWindow( wxCloseEvent& event );
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
void OnSize( wxSizeEvent &event );
+ void OnIdle( wxIdleEvent &event );
void OnMenuHighlight( wxMenuEvent& event );
class wxRadioBox: public wxControl
{
-
- DECLARE_DYNAMIC_CLASS(wxRadioBox)
-
public:
wxRadioBox();
inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
int GetNumberOfRowsOrCols() const;
void SetNumberOfRowsOrCols( int n );
- void OnSize( wxSizeEvent &event );
void SetFocus();
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle();
wxSize LayoutItems();
+ void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
bool m_alreadySent;
int m_majorDim;
wxList m_boxes;
- DECLARE_EVENT_TABLE()
+private:
+ DECLARE_DYNAMIC_CLASS(wxRadioBox)
};
#endif
void OnCloseWindow( wxCloseEvent& event );
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
void OnSize( wxSizeEvent &event );
+ void OnIdle( wxIdleEvent &event );
void OnMenuHighlight( wxMenuEvent& event );
class wxRadioBox: public wxControl
{
-
- DECLARE_DYNAMIC_CLASS(wxRadioBox)
-
public:
wxRadioBox();
inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title,
int GetNumberOfRowsOrCols() const;
void SetNumberOfRowsOrCols( int n );
- void OnSize( wxSizeEvent &event );
void SetFocus();
// implementation
bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle();
wxSize LayoutItems();
+ void DoSetSize( int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO );
bool m_alreadySent;
int m_majorDim;
wxList m_boxes;
- DECLARE_EVENT_TABLE()
+private:
+ DECLARE_DYNAMIC_CLASS(wxRadioBox)
};
#endif
DATADIRS = helpfiles
DATAFILES = helpfiles/Index.hhk helpfiles/book1.htm helpfiles/book2.htm \
- helpfiles/contents.hhc helpfiles/main.htm helpfiles/page2-b.htm helpfiles/testing.hhp
+ helpfiles/contents.hhc helpfiles/main.htm helpfiles/page2-b.htm helpfiles/testing.hhp \
+ helpfiles/another.hhc helpfiles/another.hhp helpfiles/another.htm
PROGRAM=help
#include "wx/menu.h"
#include "wx/menuitem.h"
-#ifndef __WXGTK__
void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) )
{
- DoMenuUpdates();
+ DoMenuUpdates();
}
-#endif
// update all menus
void wxFrame::DoMenuUpdates()
{
- wxMenuBar* bar = GetMenuBar();
+ wxMenuBar* bar = GetMenuBar();
- if ( bar != NULL ) {
- int nCount = bar->GetMenuCount();
- for (int n = 0; n < nCount; n++)
- DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL);
- }
+ if ( bar != NULL )
+ {
+ int nCount = bar->GetMenuCount();
+ for (int n = 0; n < nCount; n++)
+ DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL);
+ }
}
// update a menu and all submenus recursively
m_returnCode = 0;
m_sizeSet = FALSE;
m_modalShowing = FALSE;
+ m_isFrame = TRUE;
}
wxDialog::wxDialog( wxWindow *parent,
if (g_isIdle)
wxapp_install_idle_handler();
- if (!win->m_hasVMT) return;
+ if (!win->m_hasVMT)
+ return;
if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
{
+/*
+ wxPrintf( "OnSize from " );
+ if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+ wxPrintf( win->GetClassInfo()->GetClassName() );
+ wxPrintf( " %d %d %d %d\n", (int)alloc->x,
+ (int)alloc->y,
+ (int)alloc->width,
+ (int)alloc->height );
+*/
win->m_width = alloc->width;
win->m_height = alloc->height;
win->UpdateSize();
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
EVT_SIZE(wxFrame::OnSize)
+ EVT_IDLE(wxFrame::OnIdle)
EVT_CLOSE(wxFrame::OnCloseWindow)
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
END_EVENT_TABLE()
m_menuBarDetached = FALSE;
m_toolBarDetached = FALSE;
m_insertInClientArea = TRUE;
+ m_isFrame = TRUE;
}
wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
if (m_parent) m_parent->AddChild( this );
+ /* the user resized the frame by dragging etc. */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
+ GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
+
PostCreation();
/* we cannot set MWM hints and icons before the widget has
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
- /* the user resized the frame by dragging etc. */
- gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
- GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
-
/* the only way to get the window size is to connect to this event */
gtk_signal_connect( GTK_OBJECT(m_widget), "configure_event",
GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
/* we actually set the size of a frame here and no-where else */
gtk_widget_set_usize( m_widget, m_width, m_height );
- m_sizeSet = TRUE;
- /* send size event to frame */
+ m_sizeSet = TRUE;
+
+ // send size event to frame
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
- /* send size event to status bar */
+/*
+ // send size event to status bar
if (m_frameStatusBar)
{
wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
event2.SetEventObject( m_frameStatusBar );
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
}
+*/
m_resizing = FALSE;
}
void wxFrame::OnInternalIdle()
{
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
+ {
GtkOnSize( m_x, m_y, m_width, m_height );
-
- DoMenuUpdates();
+
+ // we'll come back later
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+ return;
+ }
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
#if wxUSE_TOOLBAR
if (!win->m_hasVMT) return;
if (gdk_event->count > 0) return;
+ GtkMyFixed *myfixed = GTK_MYFIXED(widget);
+
gtk_draw_shadow( widget->style,
- widget->window,
+ myfixed->bin_window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
0, 0,
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
{
- GdkGC *gc = gdk_gc_new( widget->window );
+ GdkGC *gc = gdk_gc_new( myfixed->bin_window );
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
int x = 2;
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 18;
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
- gdk_draw_rectangle( widget->window, gc, TRUE,
+ gdk_draw_rectangle( myfixed->bin_window, gc, TRUE,
x,
3,
win->m_width - 4 - x,
font->ascent + font->descent+1 );
gdk_gc_set_foreground( gc, &widget->style->white );
- gdk_draw_string( widget->window, font, gc,
+ gdk_draw_string( myfixed->bin_window, font, gc,
x+2,
3+font->ascent,
win->m_title.mb_str() );
if (!win->m_hasVMT) return;
+ GtkMyFixed *myfixed = GTK_MYFIXED(widget);
+
gtk_draw_shadow( widget->style,
- widget->window,
+ myfixed->bin_window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
0, 0,
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
{
- GdkGC *gc = gdk_gc_new( widget->window );
+ GdkGC *gc = gdk_gc_new( myfixed->bin_window );
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
int x = 2;
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 17;
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
- gdk_draw_rectangle( widget->window, gc, TRUE,
+ gdk_draw_rectangle( myfixed->bin_window, gc, TRUE,
x,
3,
win->m_width - 4 - x,
font->ascent + font->descent+1 );
gdk_gc_set_foreground( gc, &widget->style->white );
- gdk_draw_string( widget->window, font, gc,
+ gdk_draw_string( myfixed->bin_window, font, gc,
x+2,
3+font->ascent,
win->m_title.mb_str() );
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
-BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
- EVT_SIZE(wxRadioBox::OnSize)
-END_EVENT_TABLE()
-
wxRadioBox::wxRadioBox()
{
}
}
}
-void wxRadioBox::OnSize( wxSizeEvent &event )
+void wxRadioBox::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
+ wxWindow::DoSetSize( x, y, width, height, sizeFlags );
+
LayoutItems();
-
- event.Skip();
}
wxSize wxRadioBox::LayoutItems()
#endif // GTK_MINOR_VERSION > 0
+
+//-----------------------------------------------------------------------------
+// "size_allocate"
+//-----------------------------------------------------------------------------
+
+static void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
+{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ if (!win->m_hasVMT)
+ return;
+
+ if (win->m_sizeSet)
+ return;
+
+ win->m_sizeSet = TRUE;
+
+/*
+ wxPrintf( "OnSize from " );
+ if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+ wxPrintf( win->GetClassInfo()->GetClassName() );
+ wxPrintf( " %d %d %d %d\n", (int)alloc->x,
+ (int)alloc->y,
+ (int)alloc->width,
+ (int)alloc->height );
+*/
+
+ wxSizeEvent event( win->GetSize(), win->GetId() );
+ event.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent( event );
+}
+
//-----------------------------------------------------------------------------
// key event conversion routines
//-----------------------------------------------------------------------------
(int)gdk_event->area.height );
*/
+ wxEraseEvent eevent( win->GetId() );
+ eevent.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent(eevent);
+
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
(int)rect->height );
*/
+ wxEraseEvent eevent( win->GetId() );
+ eevent.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent(eevent);
+
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
m_isStaticBox = FALSE;
m_isRadioButton = FALSE;
+ m_isFrame = FALSE;
m_acceptsFocus = FALSE;
m_cursor = *wxSTANDARD_CURSOR;
{
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
+ if (!m_isFrame)
+ {
+ /* frames have their own callback */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
+ GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
+ }
+
if (m_wxwindow)
{
if (!m_noExpose)
m_y = y;
m_width = width;
m_height = height;
+
+ m_sizeSet = FALSE;
}
else
{
+ int old_width = m_width;
+ int old_height = m_height;
+
GtkMyFixed *myfixed = GTK_MYFIXED(m_parent->m_wxwindow);
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
m_y-border,
m_width+2*border,
m_height+border+bottom_border );
- }
- m_sizeSet = TRUE;
+ if ((old_width != m_width) ||
+ (old_height != m_height))
+ {
+ m_sizeSet = FALSE;
+ }
+ }
+/*
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
-
+*/
m_resizing = FALSE;
}
(GtkMenuPositionFunc) pop_pos_callback,
(gpointer) this, // client data
0, // button used to activate it
- 0 //gs_timeLastClick // the time of activation
+ gs_timeLastClick // the time of activation
);
while (is_waiting)
m_returnCode = 0;
m_sizeSet = FALSE;
m_modalShowing = FALSE;
+ m_isFrame = TRUE;
}
wxDialog::wxDialog( wxWindow *parent,
if (g_isIdle)
wxapp_install_idle_handler();
- if (!win->m_hasVMT) return;
+ if (!win->m_hasVMT)
+ return;
if ((win->m_width != alloc->width) || (win->m_height != alloc->height))
{
+/*
+ wxPrintf( "OnSize from " );
+ if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+ wxPrintf( win->GetClassInfo()->GetClassName() );
+ wxPrintf( " %d %d %d %d\n", (int)alloc->x,
+ (int)alloc->y,
+ (int)alloc->width,
+ (int)alloc->height );
+*/
win->m_width = alloc->width;
win->m_height = alloc->height;
win->UpdateSize();
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
EVT_SIZE(wxFrame::OnSize)
+ EVT_IDLE(wxFrame::OnIdle)
EVT_CLOSE(wxFrame::OnCloseWindow)
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
END_EVENT_TABLE()
m_menuBarDetached = FALSE;
m_toolBarDetached = FALSE;
m_insertInClientArea = TRUE;
+ m_isFrame = TRUE;
}
wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
if (m_parent) m_parent->AddChild( this );
+ /* the user resized the frame by dragging etc. */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
+ GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
+
PostCreation();
/* we cannot set MWM hints and icons before the widget has
gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
GTK_SIGNAL_FUNC(gtk_frame_realized_callback), (gpointer) this );
- /* the user resized the frame by dragging etc. */
- gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
- GTK_SIGNAL_FUNC(gtk_frame_size_callback), (gpointer)this );
-
/* the only way to get the window size is to connect to this event */
gtk_signal_connect( GTK_OBJECT(m_widget), "configure_event",
GTK_SIGNAL_FUNC(gtk_frame_configure_callback), (gpointer)this );
/* we actually set the size of a frame here and no-where else */
gtk_widget_set_usize( m_widget, m_width, m_height );
- m_sizeSet = TRUE;
- /* send size event to frame */
+ m_sizeSet = TRUE;
+
+ // send size event to frame
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
- /* send size event to status bar */
+/*
+ // send size event to status bar
if (m_frameStatusBar)
{
wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
event2.SetEventObject( m_frameStatusBar );
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
}
+*/
m_resizing = FALSE;
}
void wxFrame::OnInternalIdle()
{
if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow))
+ {
GtkOnSize( m_x, m_y, m_width, m_height );
-
- DoMenuUpdates();
+
+ // we'll come back later
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+ return;
+ }
if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle();
#if wxUSE_TOOLBAR
if (!win->m_hasVMT) return;
if (gdk_event->count > 0) return;
+ GtkMyFixed *myfixed = GTK_MYFIXED(widget);
+
gtk_draw_shadow( widget->style,
- widget->window,
+ myfixed->bin_window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
0, 0,
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
{
- GdkGC *gc = gdk_gc_new( widget->window );
+ GdkGC *gc = gdk_gc_new( myfixed->bin_window );
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
int x = 2;
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 18;
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
- gdk_draw_rectangle( widget->window, gc, TRUE,
+ gdk_draw_rectangle( myfixed->bin_window, gc, TRUE,
x,
3,
win->m_width - 4 - x,
font->ascent + font->descent+1 );
gdk_gc_set_foreground( gc, &widget->style->white );
- gdk_draw_string( widget->window, font, gc,
+ gdk_draw_string( myfixed->bin_window, font, gc,
x+2,
3+font->ascent,
win->m_title.mb_str() );
if (!win->m_hasVMT) return;
+ GtkMyFixed *myfixed = GTK_MYFIXED(widget);
+
gtk_draw_shadow( widget->style,
- widget->window,
+ myfixed->bin_window,
GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
0, 0,
(win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) ||
(win->GetWindowStyle() & wxTINY_CAPTION_VERT)))
{
- GdkGC *gc = gdk_gc_new( widget->window );
+ GdkGC *gc = gdk_gc_new( myfixed->bin_window );
GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
int x = 2;
if (win->GetWindowStyle() & wxSYSTEM_MENU) x = 17;
gdk_gc_set_foreground( gc, &widget->style->bg[GTK_STATE_SELECTED] );
- gdk_draw_rectangle( widget->window, gc, TRUE,
+ gdk_draw_rectangle( myfixed->bin_window, gc, TRUE,
x,
3,
win->m_width - 4 - x,
font->ascent + font->descent+1 );
gdk_gc_set_foreground( gc, &widget->style->white );
- gdk_draw_string( widget->window, font, gc,
+ gdk_draw_string( myfixed->bin_window, font, gc,
x+2,
3+font->ascent,
win->m_title.mb_str() );
IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
-BEGIN_EVENT_TABLE(wxRadioBox, wxControl)
- EVT_SIZE(wxRadioBox::OnSize)
-END_EVENT_TABLE()
-
wxRadioBox::wxRadioBox()
{
}
}
}
-void wxRadioBox::OnSize( wxSizeEvent &event )
+void wxRadioBox::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
+ wxWindow::DoSetSize( x, y, width, height, sizeFlags );
+
LayoutItems();
-
- event.Skip();
}
wxSize wxRadioBox::LayoutItems()
#endif // GTK_MINOR_VERSION > 0
+
+//-----------------------------------------------------------------------------
+// "size_allocate"
+//-----------------------------------------------------------------------------
+
+static void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
+{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ if (!win->m_hasVMT)
+ return;
+
+ if (win->m_sizeSet)
+ return;
+
+ win->m_sizeSet = TRUE;
+
+/*
+ wxPrintf( "OnSize from " );
+ if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
+ wxPrintf( win->GetClassInfo()->GetClassName() );
+ wxPrintf( " %d %d %d %d\n", (int)alloc->x,
+ (int)alloc->y,
+ (int)alloc->width,
+ (int)alloc->height );
+*/
+
+ wxSizeEvent event( win->GetSize(), win->GetId() );
+ event.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent( event );
+}
+
//-----------------------------------------------------------------------------
// key event conversion routines
//-----------------------------------------------------------------------------
(int)gdk_event->area.height );
*/
+ wxEraseEvent eevent( win->GetId() );
+ eevent.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent(eevent);
+
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
(int)rect->height );
*/
+ wxEraseEvent eevent( win->GetId() );
+ eevent.SetEventObject( win );
+ win->GetEventHandler()->ProcessEvent(eevent);
+
wxPaintEvent event( win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
m_isStaticBox = FALSE;
m_isRadioButton = FALSE;
+ m_isFrame = FALSE;
m_acceptsFocus = FALSE;
m_cursor = *wxSTANDARD_CURSOR;
{
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
+ if (!m_isFrame)
+ {
+ /* frames have their own callback */
+ gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
+ GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
+ }
+
if (m_wxwindow)
{
if (!m_noExpose)
m_y = y;
m_width = width;
m_height = height;
+
+ m_sizeSet = FALSE;
}
else
{
+ int old_width = m_width;
+ int old_height = m_height;
+
GtkMyFixed *myfixed = GTK_MYFIXED(m_parent->m_wxwindow);
if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
m_y-border,
m_width+2*border,
m_height+border+bottom_border );
- }
- m_sizeSet = TRUE;
+ if ((old_width != m_width) ||
+ (old_height != m_height))
+ {
+ m_sizeSet = FALSE;
+ }
+ }
+/*
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
event.SetEventObject( this );
GetEventHandler()->ProcessEvent( event );
-
+*/
m_resizing = FALSE;
}
(GtkMenuPositionFunc) pop_pos_callback,
(gpointer) this, // client data
0, // button used to activate it
- 0 //gs_timeLastClick // the time of activation
+ gs_timeLastClick // the time of activation
);
while (is_waiting)
XVisualInfo *g_vi = (XVisualInfo*) NULL;
+//-----------------------------------------------------------------------------
+// idle system
+//-----------------------------------------------------------------------------
+
+extern void wxapp_install_idle_handler();
+extern bool g_isIdle;
+
//---------------------------------------------------------------------------
// wxGLContext
//---------------------------------------------------------------------------
static void
gtk_glwindow_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxGLCanvas *win )
{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
win->m_exposed = TRUE;
win->GetUpdateRegion().Union( gdk_event->area.x,
static void
gtk_glwindow_draw_callback( GtkWidget *WXUNUSED(widget), GdkRectangle *rect, wxGLCanvas *win )
{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
win->m_exposed = TRUE;
win->GetUpdateRegion().Union( rect->x, rect->y,
m_exposed = FALSE;
GetUpdateRegion().Clear();
}
-}
\ No newline at end of file
+
+ wxWindow::OnInternalIdle();
+}
#include "penguin.h"
#include <GL/glu.h>
-#include "wx/gtk/win_gtk.h"
#define VIEW_ASPECT 1.3
if (!GetContext()) return;
#endif
- printf( "on refresh.\n" );
- int x,y;
- GtkMyFixed *fixed = GTK_MYFIXED(m_wxwindow);
- gdk_window_get_size( m_wxwindow->window, &x, &y );
- printf( "-> window %d %d.\n", x, y );
- gdk_window_get_size( fixed->bin_window, &x, &y );
- printf( "-> bin_window %d %d.\n", x, y );
-
SetCurrent();
/* initialize OpenGL */
int width, height;
GetClientSize(& width, & height);
- printf( "onsize %d %d.\n", width, height );
-
#ifndef __WXMOTIF__
if (GetContext())
#endif