Reorganize idle system code.
[wxWidgets.git] / src / gtk / notebook.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/notebook.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling, Vadim Zeitlin
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
12
13 #if wxUSE_NOTEBOOK
14
15 #include "wx/notebook.h"
16
17 #ifndef WX_PRECOMP
18 #include "wx/intl.h"
19 #include "wx/log.h"
20 #include "wx/utils.h"
21 #include "wx/msgdlg.h"
22 #include "wx/bitmap.h"
23 #endif
24
25 #include "wx/imaglist.h"
26 #include "wx/fontutil.h"
27
28 #include "wx/gtk/private.h"
29
30 #include <gdk/gdkkeysyms.h>
31
32 // ----------------------------------------------------------------------------
33 // events
34 // ----------------------------------------------------------------------------
35
36 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
37 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
38
39 //-----------------------------------------------------------------------------
40 // data
41 //-----------------------------------------------------------------------------
42
43 extern bool g_blockEventsOnDrag;
44
45 //-----------------------------------------------------------------------------
46 // wxGtkNotebookPage
47 //-----------------------------------------------------------------------------
48
49 // VZ: this is rather ugly as we keep the pages themselves in an array (it
50 // allows us to have quite a few functions implemented in the base class)
51 // but the page data is kept in a separate list, so we must maintain them
52 // in sync manually... of course, the list had been there before the base
53 // class which explains it but it still would be nice to do something
54 // about this one day
55
56 class wxGtkNotebookPage: public wxObject
57 {
58 public:
59 wxGtkNotebookPage()
60 {
61 m_image = -1;
62 m_page = (GtkNotebookPage *) NULL;
63 m_box = (GtkWidget *) NULL;
64 }
65
66 wxString m_text;
67 int m_image;
68 GtkNotebookPage *m_page;
69 GtkLabel *m_label;
70 GtkWidget *m_box; // in which the label and image are packed
71 };
72
73
74 #include "wx/listimpl.cpp"
75 WX_DEFINE_LIST(wxGtkNotebookPagesList)
76
77
78 //-----------------------------------------------------------------------------
79 // "switch_page"
80 //-----------------------------------------------------------------------------
81
82 extern "C" {
83 static void gtk_notebook_page_changing_callback( GtkNotebook *widget,
84 GtkNotebookPage *WXUNUSED(gpage),
85 guint page,
86 wxNotebook *notebook )
87 {
88 int old = gtk_notebook_get_current_page( widget );
89
90 if ( !notebook->SendPageChangingEvent(page) )
91 {
92 // program doesn't allow the page change
93 g_signal_stop_emission_by_name(notebook->m_widget, "switch_page");
94 }
95 else
96 {
97 // the page change event also reports the old page
98 notebook->m_oldSelection = old;
99 }
100 }
101 }
102
103 extern "C" {
104 static void gtk_notebook_page_changed_callback( GtkNotebook *widget,
105 GtkNotebookPage *WXUNUSED(gpage),
106 guint page,
107 wxNotebook *notebook )
108 {
109 int old = notebook->m_oldSelection;
110 notebook->SendPageChangedEvent( old );
111 }
112 }
113
114 //-----------------------------------------------------------------------------
115 // "size_allocate"
116 //-----------------------------------------------------------------------------
117
118 extern "C" {
119 static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
120 {
121 if ((win->m_x == alloc->x) &&
122 (win->m_y == alloc->y) &&
123 (win->m_width == alloc->width) &&
124 (win->m_height == alloc->height))
125 {
126 return;
127 }
128
129 win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
130
131 /* GTK 1.2 up to version 1.2.5 is broken so that we have to call allocate
132 here in order to make repositioning after resizing to take effect. */
133 if ((gtk_major_version == 1) &&
134 (gtk_minor_version == 2) &&
135 (gtk_micro_version < 6) &&
136 (win->m_wxwindow) &&
137 (GTK_WIDGET_REALIZED(win->m_wxwindow)))
138 {
139 gtk_widget_size_allocate( win->m_wxwindow, alloc );
140 }
141 }
142 }
143
144 //-----------------------------------------------------------------------------
145 // "realize" from m_widget
146 //-----------------------------------------------------------------------------
147
148 extern "C" {
149 static void
150 gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
151 {
152 /* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize
153 here in order to make repositioning before showing to take effect. */
154 gtk_widget_queue_resize( win->m_widget );
155 }
156 }
157
158 //-----------------------------------------------------------------------------
159 // InsertChild callback for wxNotebook
160 //-----------------------------------------------------------------------------
161
162 static void wxInsertChildInNotebook( wxNotebook* parent, wxWindow* child )
163 {
164 // Hack Alert! (Part I): This sets the notebook as the parent of the child
165 // widget, and takes care of some details such as updating the state and
166 // style of the child to reflect its new location. We do this early
167 // because without it GetBestSize (which is used to set the initial size
168 // of controls if an explicit size is not given) will often report
169 // incorrect sizes since the widget's style context is not fully known.
170 // See bug #901694 for details
171 // (http://sourceforge.net/tracker/?func=detail&aid=901694&group_id=9863&atid=109863)
172 gtk_widget_set_parent(child->m_widget, parent->m_widget);
173
174 // NOTE: This should be considered a temporary workaround until we can
175 // work out the details and implement delaying the setting of the initial
176 // size of widgets until the size is really needed.
177 }
178
179 //-----------------------------------------------------------------------------
180 // wxNotebook
181 //-----------------------------------------------------------------------------
182
183 IMPLEMENT_DYNAMIC_CLASS(wxNotebook,wxControl)
184
185 BEGIN_EVENT_TABLE(wxNotebook, wxControl)
186 EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
187 END_EVENT_TABLE()
188
189 void wxNotebook::Init()
190 {
191 m_padding = 0;
192
193 m_imageList = (wxImageList *) NULL;
194 m_oldSelection = -1;
195 m_themeEnabled = true;
196 }
197
198 wxNotebook::wxNotebook()
199 {
200 Init();
201 }
202
203 wxNotebook::wxNotebook( wxWindow *parent, wxWindowID id,
204 const wxPoint& pos, const wxSize& size,
205 long style, const wxString& name )
206 {
207 Init();
208 Create( parent, id, pos, size, style, name );
209 }
210
211 wxNotebook::~wxNotebook()
212 {
213 DeleteAllPages();
214 }
215
216 bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
217 const wxPoint& pos, const wxSize& size,
218 long style, const wxString& name )
219 {
220 m_needParent = true;
221 m_insertCallback = (wxInsertChildFunction)wxInsertChildInNotebook;
222
223 if ( (style & wxBK_ALIGN_MASK) == wxBK_DEFAULT )
224 style |= wxBK_TOP;
225
226 if (!PreCreation( parent, pos, size ) ||
227 !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
228 {
229 wxFAIL_MSG( wxT("wxNoteBook creation failed") );
230 return false;
231 }
232
233
234 m_widget = gtk_notebook_new();
235
236 gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
237
238 g_signal_connect (m_widget, "switch_page",
239 G_CALLBACK (gtk_notebook_page_changing_callback), this);
240
241 g_signal_connect_after (m_widget, "switch_page",
242 G_CALLBACK (gtk_notebook_page_changed_callback), this);
243
244 m_parent->DoAddChild( this );
245
246 if (m_windowStyle & wxBK_RIGHT)
247 gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_RIGHT );
248 if (m_windowStyle & wxBK_LEFT)
249 gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_LEFT );
250 if (m_windowStyle & wxBK_BOTTOM)
251 gtk_notebook_set_tab_pos( GTK_NOTEBOOK(m_widget), GTK_POS_BOTTOM );
252
253 PostCreation(size);
254
255 g_signal_connect (m_widget, "realize",
256 G_CALLBACK (gtk_notebook_realized_callback), this);
257
258 return true;
259 }
260
261 int wxNotebook::GetSelection() const
262 {
263 wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
264
265 return gtk_notebook_get_current_page( GTK_NOTEBOOK(m_widget) );
266 }
267
268 wxString wxNotebook::GetPageText( size_t page ) const
269 {
270 wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid notebook") );
271
272 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
273 if (nb_page)
274 return nb_page->m_text;
275 else
276 return wxEmptyString;
277 }
278
279 int wxNotebook::GetPageImage( size_t page ) const
280 {
281 wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
282
283 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
284 if (nb_page)
285 return nb_page->m_image;
286 else
287 return -1;
288 }
289
290 wxGtkNotebookPage* wxNotebook::GetNotebookPage( int page ) const
291 {
292 wxCHECK_MSG( m_widget != NULL, (wxGtkNotebookPage*) NULL, wxT("invalid notebook") );
293
294 wxCHECK_MSG( page < (int)m_pagesData.GetCount(), (wxGtkNotebookPage*) NULL, wxT("invalid notebook index") );
295
296 return m_pagesData.Item(page)->GetData();
297 }
298
299 int wxNotebook::DoSetSelection( size_t page, int flags )
300 {
301 wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
302
303 wxCHECK_MSG( page < m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
304
305 int selOld = GetSelection();
306
307 if ( !(flags & SetSelection_SendEvent) )
308 {
309 g_signal_handlers_disconnect_by_func (m_widget,
310 (gpointer) gtk_notebook_page_changing_callback,
311 this);
312
313 g_signal_handlers_disconnect_by_func (m_widget,
314 (gpointer) gtk_notebook_page_changed_callback,
315 this);
316 }
317
318 gtk_notebook_set_current_page( GTK_NOTEBOOK(m_widget), page );
319
320 if ( !(flags & SetSelection_SendEvent) )
321 {
322 // reconnect to signals
323
324 g_signal_connect (m_widget, "switch_page",
325 G_CALLBACK (gtk_notebook_page_changing_callback), this);
326
327 g_signal_connect_after (m_widget, "switch_page",
328 G_CALLBACK (gtk_notebook_page_changed_callback), this);
329 }
330
331 wxNotebookPage *client = GetPage(page);
332 if ( client )
333 client->SetFocus();
334
335 return selOld;
336 }
337
338 bool wxNotebook::SetPageText( size_t page, const wxString &text )
339 {
340 wxCHECK_MSG( m_widget != NULL, false, wxT("invalid notebook") );
341
342 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
343
344 wxCHECK_MSG( nb_page, false, wxT("SetPageText: invalid page index") );
345
346 nb_page->m_text = text;
347
348 gtk_label_set_text( nb_page->m_label, wxGTK_CONV( nb_page->m_text ) );
349
350 return true;
351 }
352
353 bool wxNotebook::SetPageImage( size_t page, int image )
354 {
355 /* HvdH 28-12-98: now it works, but it's a bit of a kludge */
356
357 wxGtkNotebookPage* nb_page = GetNotebookPage(page);
358
359 if (!nb_page) return false;
360
361 /* Optimization posibility: return immediately if image unchanged.
362 * Not enabled because it may break existing (stupid) code that
363 * manipulates the imagelist to cycle images */
364
365 /* if (image == nb_page->m_image) return true; */
366
367 /* For different cases:
368 1) no image -> no image
369 2) image -> no image
370 3) no image -> image
371 4) image -> image */
372
373 if (image == -1 && nb_page->m_image == -1)
374 return true; /* Case 1): Nothing to do. */
375
376 GtkWidget *pixmapwid = (GtkWidget*) NULL;
377
378 if (nb_page->m_image != -1)
379 {
380 /* Case 2) or 4). There is already an image in the gtkhbox. Let's find it */
381
382 GList *child = gtk_container_get_children(GTK_CONTAINER(nb_page->m_box));
383 while (child)
384 {
385 if (GTK_IS_IMAGE(child->data))
386 {
387 pixmapwid = GTK_WIDGET(child->data);
388 break;
389 }
390 child = child->next;
391 }
392
393 /* We should have the pixmap widget now */
394 wxASSERT(pixmapwid != NULL);
395
396 if (image == -1)
397 {
398 /* If there's no new widget, just remove the old from the box */
399 gtk_container_remove(GTK_CONTAINER(nb_page->m_box), pixmapwid);
400 nb_page->m_image = -1;
401
402 return true; /* Case 2) */
403 }
404 }
405
406 /* Only cases 3) and 4) left */
407 wxASSERT( m_imageList != NULL ); /* Just in case */
408
409 /* Construct the new pixmap */
410 const wxBitmap *bmp = m_imageList->GetBitmapPtr(image);
411
412 if (pixmapwid == NULL)
413 {
414 /* Case 3) No old pixmap. Create a new one and prepend it to the hbox */
415 pixmapwid = gtk_image_new_from_pixbuf(bmp->GetPixbuf());
416
417 /* CHECKME: Are these pack flags okay? */
418 gtk_box_pack_start(GTK_BOX(nb_page->m_box), pixmapwid, FALSE, FALSE, m_padding);
419 gtk_widget_show(pixmapwid);
420 }
421 else
422 {
423 /* Case 4) Simply replace the pixmap */
424 gtk_image_set_from_pixbuf((GtkImage*)pixmapwid, bmp->GetPixbuf());
425 }
426
427 nb_page->m_image = image;
428
429 return true;
430 }
431
432 void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
433 {
434 wxFAIL_MSG( wxT("wxNotebook::SetPageSize not implemented") );
435 }
436
437 void wxNotebook::SetPadding( const wxSize &padding )
438 {
439 wxCHECK_RET( m_widget != NULL, wxT("invalid notebook") );
440
441 m_padding = padding.GetWidth();
442
443 int i;
444 for (i=0; i<int(GetPageCount()); i++)
445 {
446 wxGtkNotebookPage* nb_page = GetNotebookPage(i);
447 wxASSERT(nb_page != NULL);
448
449 if (nb_page->m_image != -1)
450 {
451 // gtk_box_set_child_packing sets padding on BOTH sides
452 // icon provides left padding, label provides center and right
453 int image = nb_page->m_image;
454 SetPageImage(i,-1);
455 SetPageImage(i,image);
456 }
457 wxASSERT(nb_page->m_label);
458 gtk_box_set_child_packing(GTK_BOX(nb_page->m_box),
459 GTK_WIDGET(nb_page->m_label),
460 FALSE, FALSE, m_padding, GTK_PACK_END);
461 }
462 }
463
464 void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz))
465 {
466 wxFAIL_MSG( wxT("wxNotebook::SetTabSize not implemented") );
467 }
468
469 bool wxNotebook::DeleteAllPages()
470 {
471 wxCHECK_MSG( m_widget != NULL, false, wxT("invalid notebook") );
472
473 while (m_pagesData.GetCount() > 0)
474 DeletePage( m_pagesData.GetCount()-1 );
475
476 wxASSERT_MSG( GetPageCount() == 0, _T("all pages must have been deleted") );
477
478 InvalidateBestSize();
479 return wxNotebookBase::DeleteAllPages();
480 }
481
482 wxNotebookPage *wxNotebook::DoRemovePage( size_t page )
483 {
484 wxNotebookPage *client = wxNotebookBase::DoRemovePage(page);
485 if ( !client )
486 return NULL;
487
488 gtk_widget_ref( client->m_widget );
489 gtk_widget_unrealize( client->m_widget );
490
491 // we don't need to unparent the client->m_widget; GTK+ will do
492 // that for us (and will throw a warning if we do it!)
493
494 gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page );
495
496 wxGtkNotebookPage* p = GetNotebookPage(page);
497 m_pagesData.DeleteObject(p);
498 delete p;
499
500 return client;
501 }
502
503 bool wxNotebook::InsertPage( size_t position,
504 wxNotebookPage* win,
505 const wxString& text,
506 bool select,
507 int imageId )
508 {
509 wxCHECK_MSG( m_widget != NULL, false, wxT("invalid notebook") );
510
511 wxCHECK_MSG( win->GetParent() == this, false,
512 wxT("Can't add a page whose parent is not the notebook!") );
513
514 wxCHECK_MSG( position <= GetPageCount(), false,
515 _T("invalid page index in wxNotebookPage::InsertPage()") );
516
517 // Hack Alert! (Part II): See above in wxInsertChildInNotebook callback
518 // why this has to be done. NOTE: using gtk_widget_unparent here does not
519 // work as it seems to undo too much and will cause errors in the
520 // gtk_notebook_insert_page below, so instead just clear the parent by
521 // hand here.
522 win->m_widget->parent = NULL;
523
524 if (m_themeEnabled)
525 win->SetThemeEnabled(true);
526
527 GtkNotebook *notebook = GTK_NOTEBOOK(m_widget);
528
529 wxGtkNotebookPage *nb_page = new wxGtkNotebookPage();
530
531 if ( position == GetPageCount() )
532 m_pagesData.Append( nb_page );
533 else
534 m_pagesData.Insert( position, nb_page );
535
536 m_pages.Insert(win, position);
537
538 nb_page->m_box = gtk_hbox_new( FALSE, 1 );
539 gtk_container_set_border_width((GtkContainer*)nb_page->m_box, 2);
540
541 g_signal_connect (win->m_widget, "size_allocate",
542 G_CALLBACK (gtk_page_size_callback), win);
543
544 gtk_notebook_insert_page( notebook, win->m_widget, nb_page->m_box, position );
545
546 nb_page->m_page = (GtkNotebookPage*) g_list_last(notebook->children)->data;
547
548 /* set the label image */
549 nb_page->m_image = imageId;
550
551 if (imageId != -1)
552 {
553 wxASSERT( m_imageList != NULL );
554
555 const wxBitmap *bmp = m_imageList->GetBitmapPtr(imageId);
556 GtkWidget* pixmapwid = gtk_image_new_from_pixbuf(bmp->GetPixbuf());
557 gtk_box_pack_start(GTK_BOX(nb_page->m_box), pixmapwid, FALSE, FALSE, m_padding);
558 gtk_widget_show(pixmapwid);
559 }
560
561 /* set the label text */
562
563 nb_page->m_text = wxStripMenuCodes(text);
564 if (nb_page->m_text.empty()) nb_page->m_text = wxEmptyString;
565
566 nb_page->m_label = GTK_LABEL( gtk_label_new(wxGTK_CONV(nb_page->m_text)) );
567 gtk_box_pack_end( GTK_BOX(nb_page->m_box), GTK_WIDGET(nb_page->m_label), FALSE, FALSE, m_padding );
568
569 /* apply current style */
570 GtkRcStyle *style = CreateWidgetStyle();
571 if ( style )
572 {
573 gtk_widget_modify_style(GTK_WIDGET(nb_page->m_label), style);
574 gtk_rc_style_unref(style);
575 }
576
577 /* show the label */
578 gtk_widget_show( GTK_WIDGET(nb_page->m_label) );
579
580 if (select && (m_pagesData.GetCount() > 1))
581 {
582 SetSelection( position );
583 }
584
585 InvalidateBestSize();
586 return true;
587 }
588
589 // helper for HitTest(): check if the point lies inside the given widget which
590 // is the child of the notebook whose position and border size are passed as
591 // parameters
592 static bool
593 IsPointInsideWidget(const wxPoint& pt, GtkWidget *w,
594 gint x, gint y, gint border = 0)
595 {
596 return
597 (pt.x >= w->allocation.x - x - border) &&
598 (pt.x <= w->allocation.x - x + border + w->allocation.width) &&
599 (pt.y >= w->allocation.y - y - border) &&
600 (pt.y <= w->allocation.y - y + border + w->allocation.height);
601 }
602
603 int wxNotebook::HitTest(const wxPoint& pt, long *flags) const
604 {
605 const gint x = m_widget->allocation.x;
606 const gint y = m_widget->allocation.y;
607
608 const size_t count = GetPageCount();
609 size_t i = 0;
610
611 GtkNotebook * notebook = GTK_NOTEBOOK(m_widget);
612 if (gtk_notebook_get_scrollable(notebook))
613 i = g_list_position( notebook->children, notebook->first_tab );
614
615 for ( ; i < count; i++ )
616 {
617 wxGtkNotebookPage* nb_page = GetNotebookPage(i);
618 GtkWidget *box = nb_page->m_box;
619
620 const gint border = gtk_container_get_border_width(GTK_CONTAINER(box));
621
622 if ( IsPointInsideWidget(pt, box, x, y, border) )
623 {
624 // ok, we're inside this tab -- now find out where, if needed
625 if ( flags )
626 {
627 GtkWidget *pixmap = NULL;
628
629 GList *children = gtk_container_get_children(GTK_CONTAINER(box));
630 for ( GList *child = children; child; child = child->next )
631 {
632 if (GTK_IS_IMAGE(child->data))
633 {
634 pixmap = GTK_WIDGET(child->data);
635 break;
636 }
637 }
638
639 if ( children )
640 g_list_free(children);
641
642 if ( pixmap && IsPointInsideWidget(pt, pixmap, x, y) )
643 {
644 *flags = wxBK_HITTEST_ONICON;
645 }
646 else if ( IsPointInsideWidget(pt, GTK_WIDGET(nb_page->m_label), x, y) )
647 {
648 *flags = wxBK_HITTEST_ONLABEL;
649 }
650 else
651 {
652 *flags = wxBK_HITTEST_ONITEM;
653 }
654 }
655
656 return i;
657 }
658 }
659
660 if ( flags )
661 {
662 *flags = wxBK_HITTEST_NOWHERE;
663 wxWindowBase * page = GetCurrentPage();
664 if ( page )
665 {
666 // rect origin is in notebook's parent coordinates
667 wxRect rect = page->GetRect();
668
669 // adjust it to the notebook's coordinates
670 wxPoint pos = GetPosition();
671 rect.x -= pos.x;
672 rect.y -= pos.y;
673 if ( rect.Contains( pt ) )
674 *flags |= wxBK_HITTEST_ONPAGE;
675 }
676 }
677
678 return wxNOT_FOUND;
679 }
680
681 void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
682 {
683 if (event.IsWindowChange())
684 AdvanceSelection( event.GetDirection() );
685 else
686 event.Skip();
687 }
688
689 #if wxUSE_CONSTRAINTS
690
691 // override these 2 functions to do nothing: everything is done in OnSize
692 void wxNotebook::SetConstraintSizes( bool WXUNUSED(recurse) )
693 {
694 // don't set the sizes of the pages - their correct size is not yet known
695 wxControl::SetConstraintSizes(false);
696 }
697
698 bool wxNotebook::DoPhase( int WXUNUSED(nPhase) )
699 {
700 return true;
701 }
702
703 #endif
704
705 void wxNotebook::DoApplyWidgetStyle(GtkRcStyle *style)
706 {
707 gtk_widget_modify_style(m_widget, style);
708 size_t cnt = m_pagesData.GetCount();
709 for (size_t i = 0; i < cnt; i++)
710 gtk_widget_modify_style(GTK_WIDGET(GetNotebookPage(i)->m_label), style);
711 }
712
713 GdkWindow *wxNotebook::GTKGetWindow(wxArrayGdkWindows& windows) const
714 {
715 windows.push_back(m_widget->window);
716 windows.push_back(GTK_NOTEBOOK(m_widget)->event_window);
717
718 return NULL;
719 }
720
721 // static
722 wxVisualAttributes
723 wxNotebook::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
724 {
725 return GetDefaultAttributesFromGTKWidget(gtk_notebook_new);
726 }
727
728 //-----------------------------------------------------------------------------
729 // wxNotebookEvent
730 //-----------------------------------------------------------------------------
731
732 IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent)
733
734 #endif