1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation "frame.h"
15 #include "wx/dialog.h"
16 #include "wx/control.h"
19 #include "wx/toolbar.h"
20 #include "wx/statusbr.h"
21 #include "wx/dcclient.h"
26 #include "wx/gtk/win_gtk.h"
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
32 const int wxMENU_HEIGHT
= 27;
33 const int wxSTATUS_HEIGHT
= 25;
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 extern wxList wxPendingDelete
;
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
45 static void gtk_frame_size_callback( GtkWidget
*WXUNUSED(widget
), GtkAllocation
* alloc
, wxFrame
*win
)
47 if (!win
->HasVMT()) return;
50 printf( "OnFrameResize from " );
51 if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
52 printf( win->GetClassInfo()->GetClassName() );
56 if ((win
->m_width
!= alloc
->width
) || (win
->m_height
!= alloc
->height
))
58 win
->m_sizeSet
= FALSE
;
59 win
->m_width
= alloc
->width
;
60 win
->m_height
= alloc
->height
;
64 //-----------------------------------------------------------------------------
66 //-----------------------------------------------------------------------------
68 static gint
gtk_frame_delete_callback( GtkWidget
*WXUNUSED(widget
), GdkEvent
*WXUNUSED(event
), wxFrame
*win
)
71 printf( "OnDelete from " );
72 if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
73 printf( win->GetClassInfo()->GetClassName() );
82 //-----------------------------------------------------------------------------
84 //-----------------------------------------------------------------------------
86 static gint
gtk_frame_configure_callback( GtkWidget
*WXUNUSED(widget
), GdkEventConfigure
*event
, wxFrame
*win
)
88 if (!win
->HasVMT()) return FALSE
;
93 wxMoveEvent
mevent( wxPoint(win
->m_x
,win
->m_y
), win
->GetId() );
94 mevent
.SetEventObject( win
);
95 win
->GetEventHandler()->ProcessEvent( mevent
);
100 //-----------------------------------------------------------------------------
101 // InsertChild for wxFrame
102 //-----------------------------------------------------------------------------
104 /* Callback for wxFrame. This very strange beast has to be used because
105 * C++ has no virtual methods in a constructor. We have to emulate a
106 * virtual function here as wxWindows requires different ways to insert
107 * a child in container classes. */
109 static void wxInsertChildInFrame( wxWindow
* parent
, wxWindow
* child
)
111 if (wxIS_KIND_OF(child
,wxToolBar
) || wxIS_KIND_OF(child
,wxMenuBar
))
113 /* these are outside the client area */
114 wxFrame
* frame
= (wxFrame
*) parent
;
115 gtk_myfixed_put( GTK_MYFIXED(frame
->m_mainWidget
),
116 GTK_WIDGET(child
->m_widget
),
122 /* these are inside the client area */
123 gtk_myfixed_put( GTK_MYFIXED(parent
->m_wxwindow
),
124 GTK_WIDGET(child
->m_widget
),
129 gtk_widget_set_usize( GTK_WIDGET(child
->m_widget
),
133 /* resize on OnInternalIdle */
134 parent
->m_sizeSet
= FALSE
;
136 if (parent
->m_windowStyle
& wxTAB_TRAVERSAL
)
138 /* we now allow a window to get the focus as long as it
139 doesn't have any children. */
140 GTK_WIDGET_UNSET_FLAGS( parent
->m_wxwindow
, GTK_CAN_FOCUS
);
144 //-----------------------------------------------------------------------------
146 //-----------------------------------------------------------------------------
148 BEGIN_EVENT_TABLE(wxFrame
, wxWindow
)
149 EVT_SIZE(wxFrame::OnSize
)
150 EVT_CLOSE(wxFrame::OnCloseWindow
)
151 EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight
)
154 IMPLEMENT_DYNAMIC_CLASS(wxFrame
,wxWindow
)
158 m_frameMenuBar
= (wxMenuBar
*) NULL
;
159 m_mdiMenuBar
= (wxMenuBar
*) NULL
;
160 m_frameStatusBar
= (wxStatusBar
*) NULL
;
161 m_frameToolBar
= (wxToolBar
*) NULL
;
167 wxFrame::wxFrame( wxWindow
*parent
, wxWindowID id
, const wxString
&title
,
168 const wxPoint
&pos
, const wxSize
&size
,
169 long style
, const wxString
&name
)
171 m_frameMenuBar
= (wxMenuBar
*) NULL
;
172 m_mdiMenuBar
= (wxMenuBar
*) NULL
;
173 m_frameStatusBar
= (wxStatusBar
*) NULL
;
174 m_frameToolBar
= (wxToolBar
*) NULL
;
178 Create( parent
, id
, title
, pos
, size
, style
, name
);
181 bool wxFrame::Create( wxWindow
*parent
, wxWindowID id
, const wxString
&title
,
182 const wxPoint
&pos
, const wxSize
&size
,
183 long style
, const wxString
&name
)
185 wxTopLevelWindows
.Append( this );
187 m_needParent
= FALSE
;
189 PreCreation( parent
, id
, pos
, size
, style
, name
);
193 m_insertCallback
= wxInsertChildInFrame
;
195 GtkWindowType win_type
= GTK_WINDOW_TOPLEVEL
;
196 if (style
& wxSIMPLE_BORDER
) win_type
= GTK_WINDOW_POPUP
;
198 m_widget
= gtk_window_new( win_type
);
200 gtk_window_set_title( GTK_WINDOW(m_widget
), title
);
201 GTK_WIDGET_UNSET_FLAGS( m_widget
, GTK_CAN_FOCUS
);
203 gtk_window_set_policy( GTK_WINDOW(m_widget
), 1, 1, 0 );
205 gtk_signal_connect( GTK_OBJECT(m_widget
), "delete_event",
206 GTK_SIGNAL_FUNC(gtk_frame_delete_callback
), (gpointer
)this );
208 /* m_mainWidget holds the toolbar, the menubar and the client area */
209 m_mainWidget
= gtk_myfixed_new();
210 gtk_widget_show( m_mainWidget
);
211 GTK_WIDGET_UNSET_FLAGS( m_mainWidget
, GTK_CAN_FOCUS
);
212 gtk_container_add( GTK_CONTAINER(m_widget
), m_mainWidget
);
213 gtk_widget_realize( m_mainWidget
);
215 /* m_wxwindow only represents the client area without toolbar and menubar */
216 m_wxwindow
= gtk_myfixed_new();
217 gtk_widget_show( m_wxwindow
);
218 GTK_WIDGET_UNSET_FLAGS( m_wxwindow
, GTK_CAN_FOCUS
);
219 gtk_container_add( GTK_CONTAINER(m_mainWidget
), m_wxwindow
);
221 if (m_parent
) m_parent
->AddChild( this );
225 gtk_widget_realize( m_widget
);
227 long decor
= (long) GDK_DECOR_ALL
;
228 long func
= (long) GDK_FUNC_ALL
;
230 if ((m_windowStyle
& wxCAPTION
) == 0)
231 decor
|= GDK_DECOR_TITLE
;
232 if ((m_windowStyle
& wxMINIMIZE
) == 0)
233 func
|= GDK_FUNC_MINIMIZE
;
234 if ((m_windowStyle
& wxMAXIMIZE
) == 0)
235 func
|= GDK_FUNC_MAXIMIZE
;
236 if ((m_windowStyle
& wxSYSTEM_MENU
) == 0)
237 decor
|= GDK_DECOR_MENU
;
238 if ((m_windowStyle
& wxMINIMIZE_BOX
) == 0)
239 decor
|= GDK_DECOR_MINIMIZE
;
240 if ((m_windowStyle
& wxMAXIMIZE_BOX
) == 0)
241 decor
|= GDK_DECOR_MAXIMIZE
;
242 if ((m_windowStyle
& wxRESIZE_BORDER
) == 0)
243 func
|= GDK_FUNC_RESIZE
;
245 gdk_window_set_decorations(m_widget
->window
, (GdkWMDecoration
)decor
);
246 gdk_window_set_functions(m_widget
->window
, (GdkWMFunction
)func
);
248 gtk_signal_connect( GTK_OBJECT(m_widget
), "size_allocate",
249 GTK_SIGNAL_FUNC(gtk_frame_size_callback
), (gpointer
)this );
251 gtk_signal_connect( GTK_OBJECT(m_widget
), "configure_event",
252 GTK_SIGNAL_FUNC(gtk_frame_configure_callback
), (gpointer
)this );
259 if (m_frameMenuBar
) delete m_frameMenuBar
;
260 m_frameMenuBar
= (wxMenuBar
*) NULL
;
262 if (m_frameStatusBar
) delete m_frameStatusBar
;
263 m_frameStatusBar
= (wxStatusBar
*) NULL
;
265 if (m_frameToolBar
) delete m_frameToolBar
;
266 m_frameToolBar
= (wxToolBar
*) NULL
;
268 wxTopLevelWindows
.DeleteObject( this );
270 if (wxTheApp
->GetTopWindow() == this)
272 wxTheApp
->SetTopWindow( (wxWindow
*) NULL
);
275 if (wxTopLevelWindows
.Number() == 0)
277 wxTheApp
->ExitMainLoop();
281 bool wxFrame::Show( bool show
)
283 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
285 if (show
&& !m_sizeSet
)
287 /* by calling GtkOnSize here, we don't have to call
288 either after showing the frame, which would entail
289 much ugly flicker or from within the size_allocate
290 handler, because GTK 1.1.X forbids that. */
292 GtkOnSize( m_x
, m_y
, m_width
, m_height
);
295 return wxWindow::Show( show
);
298 bool wxFrame::Destroy()
300 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
302 if (!wxPendingDelete
.Member(this)) wxPendingDelete
.Append(this);
307 void wxFrame::DoSetSize( int x
, int y
, int width
, int height
, int sizeFlags
)
309 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
311 /* don't do anything for children of wxMDIChildFrame */
312 if (!m_wxwindow
) return;
314 if (m_resizing
) return; // I don't like recursions
319 int old_width
= m_width
;
320 int old_height
= m_height
;
322 if ((sizeFlags
& wxSIZE_USE_EXISTING
) == wxSIZE_USE_EXISTING
)
324 if (x
!= -1) m_x
= x
;
325 if (y
!= -1) m_y
= y
;
326 if (width
!= -1) m_width
= width
;
327 if (height
!= -1) m_height
= height
;
337 if ((sizeFlags
& wxSIZE_AUTO_WIDTH
) == wxSIZE_AUTO_WIDTH
)
339 if (width
== -1) m_width
= 80;
342 if ((sizeFlags
& wxSIZE_AUTO_HEIGHT
) == wxSIZE_AUTO_HEIGHT
)
344 if (height
== -1) m_height
= 26;
347 if ((m_minWidth
!= -1) && (m_width
< m_minWidth
)) m_width
= m_minWidth
;
348 if ((m_minHeight
!= -1) && (m_height
< m_minHeight
)) m_height
= m_minHeight
;
349 if ((m_maxWidth
!= -1) && (m_width
> m_maxWidth
)) m_width
= m_maxWidth
;
350 if ((m_maxHeight
!= -1) && (m_height
> m_maxHeight
)) m_height
= m_maxHeight
;
352 if ((m_x
!= -1) || (m_y
!= -1))
354 if ((m_x
!= old_x
) || (m_y
!= old_y
))
356 /* m_sizeSet = FALSE; */
357 gtk_widget_set_uposition( m_widget
, m_x
, m_y
);
361 if ((m_width
!= old_width
) || (m_height
!= old_height
))
363 /* we set the size in GtkOnSize */
370 void wxFrame::Centre( int direction
)
372 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
377 if ((direction
& wxHORIZONTAL
) == wxHORIZONTAL
) x
= (gdk_screen_width () - m_width
) / 2;
378 if ((direction
& wxVERTICAL
) == wxVERTICAL
) y
= (gdk_screen_height () - m_height
) / 2;
383 void wxFrame::GetClientSize( int *width
, int *height
) const
385 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
387 wxWindow::GetClientSize( width
, height
);
390 if (m_frameMenuBar
) (*height
) -= wxMENU_HEIGHT
;
391 if (m_frameStatusBar
) (*height
) -= wxSTATUS_HEIGHT
;
395 m_frameToolBar
->GetSize( (int *) NULL
, &y
);
398 (*height
) -= m_miniEdge
*2 + m_miniTitle
;
402 (*width
) -= m_miniEdge
*2;
406 void wxFrame::DoSetClientSize( int width
, int height
)
408 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
411 if (m_frameMenuBar
) h
+= wxMENU_HEIGHT
;
412 if (m_frameStatusBar
) h
+= wxSTATUS_HEIGHT
;
416 m_frameToolBar
->GetSize( (int *) NULL
, &y
);
419 wxWindow::DoSetClientSize( width
+ m_miniEdge
*2, h
+ m_miniEdge
*2 + m_miniTitle
);
422 void wxFrame::GtkOnSize( int WXUNUSED(x
), int WXUNUSED(y
), int width
, int height
)
424 // due to a bug in gtk, x,y are always 0
428 if (m_resizing
) return;
431 if (!m_wxwindow
) return;
436 /* check if size is in legal range */
437 if ((m_minWidth
!= -1) && (m_width
< m_minWidth
)) m_width
= m_minWidth
;
438 if ((m_minHeight
!= -1) && (m_height
< m_minHeight
)) m_height
= m_minHeight
;
439 if ((m_maxWidth
!= -1) && (m_width
> m_maxWidth
)) m_width
= m_maxWidth
;
440 if ((m_maxHeight
!= -1) && (m_height
> m_maxHeight
)) m_height
= m_maxHeight
;
442 /* I revert back to wxGTK's original behaviour. m_mainWidget holds the
443 * menubar, the toolbar and the client area, which is represented by
445 * this hurts in the eye, but I don't want to call SetSize()
446 * because I don't want to call any non-native functions here. */
448 int client_area_y_offset
= 0;
453 int yy
= m_miniEdge
+ m_miniTitle
;
454 int ww
= m_width
- 2*m_miniEdge
;
455 int hh
= wxMENU_HEIGHT
;
456 m_frameMenuBar
->m_x
= xx
;
457 m_frameMenuBar
->m_y
= yy
;
458 m_frameMenuBar
->m_width
= ww
;
459 m_frameMenuBar
->m_height
= hh
;
461 gtk_myfixed_move( GTK_MYFIXED(m_mainWidget
), m_frameMenuBar
->m_widget
, xx
, yy
);
462 gtk_widget_set_usize( m_frameMenuBar
->m_widget
, ww
, hh
);
464 client_area_y_offset
+= hh
;
470 int yy
= m_miniEdge
+ m_miniTitle
;
471 if ((m_frameMenuBar
) || (m_mdiMenuBar
)) yy
+= wxMENU_HEIGHT
;
472 int ww
= m_width
- 2*m_miniEdge
;
473 int hh
= m_frameToolBar
->m_height
;
475 m_frameToolBar
->m_x
= xx
;
476 m_frameToolBar
->m_y
= yy
;
477 m_frameToolBar
->m_height
= hh
;
478 m_frameToolBar
->m_width
= ww
;
480 gtk_myfixed_move( GTK_MYFIXED(m_mainWidget
), m_frameToolBar
->m_widget
, xx
, yy
);
481 gtk_widget_set_usize( m_frameToolBar
->m_widget
, ww
, hh
);
483 client_area_y_offset
+= hh
;
486 gtk_myfixed_move( GTK_MYFIXED(m_mainWidget
), m_wxwindow
, 0, client_area_y_offset
);
487 gtk_widget_set_usize( m_wxwindow
, m_width
, m_height
-client_area_y_offset
);
489 if (m_frameStatusBar
)
491 int xx
= 0 + m_miniEdge
;
492 int yy
= m_height
- wxSTATUS_HEIGHT
- m_miniEdge
- client_area_y_offset
;
493 int ww
= m_width
- 2*m_miniEdge
;
494 int hh
= wxSTATUS_HEIGHT
;
496 m_frameStatusBar
->m_x
= xx
;
497 m_frameStatusBar
->m_y
= yy
;
498 m_frameStatusBar
->m_width
= ww
;
499 m_frameStatusBar
->m_height
= hh
;
501 gtk_myfixed_move( GTK_MYFIXED(m_wxwindow
), m_frameStatusBar
->m_widget
, xx
, yy
);
502 gtk_widget_set_usize( m_frameStatusBar
->m_widget
, ww
, hh
);
505 /* we actually set the size of a frame here and no-where else */
506 gtk_widget_set_usize( m_widget
, m_width
, m_height
);
510 /* send size event to frame */
511 wxSizeEvent
event( wxSize(m_width
,m_height
), GetId() );
512 event
.SetEventObject( this );
513 GetEventHandler()->ProcessEvent( event
);
515 /* send size event to status bar */
516 if (m_frameStatusBar
)
518 wxSizeEvent
event2( wxSize(m_frameStatusBar
->m_width
,m_frameStatusBar
->m_height
), m_frameStatusBar
->GetId() );
519 event2
.SetEventObject( m_frameStatusBar
);
520 m_frameStatusBar
->GetEventHandler()->ProcessEvent( event2
);
526 void wxFrame::OnInternalIdle()
529 GtkOnSize( m_x
, m_y
, m_width
, m_height
);
534 void wxFrame::OnCloseWindow( wxCloseEvent
& event
)
536 // close the window if it wasn't vetoed by the application
537 // if ( !event.GetVeto() ) // No, this isn't the interpretation of GetVeto.
541 void wxFrame::OnSize( wxSizeEvent
&WXUNUSED(event
) )
543 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
551 // do we have exactly one child?
552 wxWindow
*child
= (wxWindow
*)NULL
;
553 for ( wxNode
*node
= GetChildren().First(); node
; node
= node
->Next() )
555 wxWindow
*win
= (wxWindow
*)node
->Data();
556 if ( !wxIS_KIND_OF(win
,wxFrame
) && !wxIS_KIND_OF(win
,wxDialog
) )
560 // it's the second one: do nothing
568 // no children at all?
571 // yes: set it's size to fill all the frame
572 int client_x
, client_y
;
573 GetClientSize( &client_x
, &client_y
);
574 child
->SetSize( 1, 1, client_x
-2, client_y
-2 );
579 static void SetInvokingWindow( wxMenu
*menu
, wxWindow
*win
)
581 menu
->SetInvokingWindow( win
);
582 wxNode
*node
= menu
->GetItems().First();
585 wxMenuItem
*menuitem
= (wxMenuItem
*)node
->Data();
586 if (menuitem
->IsSubMenu())
587 SetInvokingWindow( menuitem
->GetSubMenu(), win
);
592 void wxFrame::SetMenuBar( wxMenuBar
*menuBar
)
594 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
595 wxASSERT_MSG( (m_wxwindow
!= NULL
), "invalid frame" );
597 m_frameMenuBar
= menuBar
;
601 wxNode
*node
= m_frameMenuBar
->GetMenus().First();
604 wxMenu
*menu
= (wxMenu
*)node
->Data();
605 SetInvokingWindow( menu
, this );
609 if (m_frameMenuBar
->m_parent
!= this)
611 m_frameMenuBar
->m_parent
= this;
612 gtk_myfixed_put( GTK_MYFIXED(m_mainWidget
),
613 m_frameMenuBar
->m_widget
, m_frameMenuBar
->m_x
, m_frameMenuBar
->m_y
);
615 /* an mdi child menu bar might be underneath */
617 m_frameMenuBar
->Show( FALSE
);
624 wxMenuBar
*wxFrame::GetMenuBar() const
626 return m_frameMenuBar
;
629 void wxFrame::OnMenuHighlight(wxMenuEvent
& event
)
633 // if no help string found, we will clear the status bar text
636 int menuId
= event
.GetMenuId();
639 wxMenuBar
*menuBar
= GetMenuBar();
642 helpString
= menuBar
->GetHelpString(menuId
);
646 SetStatusText(helpString
);
650 wxToolBar
* wxFrame::CreateToolBar(long style
, wxWindowID id
, const wxString
& name
)
652 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
654 wxCHECK_MSG( m_frameToolBar
== NULL
, FALSE
, "recreating toolbar in wxFrame" );
656 m_frameToolBar
= OnCreateToolBar( style
, id
, name
);
658 GetChildren().DeleteObject( m_frameToolBar
);
662 return m_frameToolBar
;
665 wxToolBar
* wxFrame::OnCreateToolBar( long style
, wxWindowID id
, const wxString
& name
)
667 return new wxToolBar( this, id
, wxDefaultPosition
, wxDefaultSize
, style
, name
);
670 wxToolBar
*wxFrame::GetToolBar() const
672 return m_frameToolBar
;
675 wxStatusBar
* wxFrame::CreateStatusBar( int number
, long style
, wxWindowID id
, const wxString
& name
)
677 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
679 wxCHECK_MSG( m_frameStatusBar
== NULL
, FALSE
, "recreating status bar in wxFrame" );
681 m_frameStatusBar
= OnCreateStatusBar( number
, style
, id
, name
);
685 return m_frameStatusBar
;
688 wxStatusBar
*wxFrame::OnCreateStatusBar( int number
, long style
, wxWindowID id
, const wxString
& name
)
690 wxStatusBar
*statusBar
= (wxStatusBar
*) NULL
;
692 statusBar
= new wxStatusBar(this, id
, wxPoint(0, 0), wxSize(100, 20), style
, name
);
694 // Set the height according to the font and the border size
695 wxClientDC
dc(statusBar
);
696 dc
.SetFont( statusBar
->GetFont() );
699 dc
.GetTextExtent( "X", &x
, &y
);
701 int height
= (int)( (y
* 1.1) + 2* statusBar
->GetBorderY());
703 statusBar
->SetSize( -1, -1, 100, height
);
705 statusBar
->SetFieldsCount( number
);
709 void wxFrame::Command( int id
)
711 wxCommandEvent
commandEvent(wxEVT_COMMAND_MENU_SELECTED
, id
);
712 commandEvent
.SetInt( id
);
713 commandEvent
.SetEventObject( this );
715 wxMenuBar
*bar
= GetMenuBar();
718 wxMenuItem
*item
= bar
->FindItemForId(id
) ;
719 if (item
&& item
->IsCheckable())
721 bar
->Check(id
,!bar
->Checked(id
)) ;
724 wxEvtHandler
* evtHandler
= GetEventHandler();
726 evtHandler
->ProcessEvent(commandEvent
);
729 void wxFrame::SetStatusText(const wxString
& text
, int number
)
731 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
733 wxCHECK_RET( m_frameStatusBar
!= NULL
, "no statusbar to set text for" );
735 m_frameStatusBar
->SetStatusText(text
, number
);
738 void wxFrame::SetStatusWidths(int n
, const int widths_field
[] )
740 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
742 wxCHECK_RET( m_frameStatusBar
!= NULL
, "no statusbar to set widths for" );
744 m_frameStatusBar
->SetStatusWidths(n
, widths_field
);
747 wxStatusBar
*wxFrame::GetStatusBar() const
749 return m_frameStatusBar
;
752 void wxFrame::SetTitle( const wxString
&title
)
754 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
757 if (m_title
.IsNull()) m_title
= "";
758 gtk_window_set_title( GTK_WINDOW(m_widget
), title
);
761 void wxFrame::SetIcon( const wxIcon
&icon
)
763 wxASSERT_MSG( (m_widget
!= NULL
), "invalid frame" );
766 if (!icon
.Ok()) return;
768 wxMask
*mask
= icon
.GetMask();
769 GdkBitmap
*bm
= (GdkBitmap
*) NULL
;
770 if (mask
) bm
= mask
->GetBitmap();
772 gdk_window_set_icon( m_widget
->window
, (GdkWindow
*) NULL
, icon
.GetPixmap(), bm
);