1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/tbargtk.cpp
3 // Purpose: GTK toolbar
4 // Author: Robert Roebling
5 // Modified: 13.12.99 by VZ to derive from wxToolBarBase
7 // Copyright: (c) Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
14 #if wxUSE_TOOLBAR_NATIVE
16 #include "wx/toolbar.h"
22 // FIXME: Use GtkImage instead of GtkPixmap. Use the new toolbar API for when gtk runtime is new enough?
23 // Beware that the new and old toolbar API may not be mixed in usage.
24 #undef GTK_DISABLE_DEPRECATED
26 #include "wx/gtk/private.h"
29 static const char *arrow_down_xpm
[] = {
30 /* columns rows colors chars-per-pixel */
45 // ----------------------------------------------------------------------------
47 // ----------------------------------------------------------------------------
50 extern bool g_blockEventsOnDrag
;
51 extern wxCursor g_globalCursor
;
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
57 // translate wxWidgets toolbar style flags to GTK orientation and style
58 static void GetGtkStyle(long style
,
59 GtkOrientation
*orient
, GtkToolbarStyle
*gtkStyle
)
61 *orient
= ( style
& wxTB_LEFT
|| style
& wxTB_RIGHT
) ? GTK_ORIENTATION_VERTICAL
: GTK_ORIENTATION_HORIZONTAL
;
64 if ( style
& wxTB_TEXT
)
66 *gtkStyle
= style
& wxTB_NOICONS
69 style
& wxTB_HORZ_LAYOUT
? GTK_TOOLBAR_BOTH_HORIZ
:
72 else // no text, hence we must have the icons or what would we show?
74 *gtkStyle
= GTK_TOOLBAR_ICONS
;
78 // ----------------------------------------------------------------------------
80 // ----------------------------------------------------------------------------
82 class wxToolBarTool
: public wxToolBarToolBase
85 wxToolBarTool(wxToolBar
*tbar
,
87 const wxString
& label
,
88 const wxBitmap
& bitmap1
,
89 const wxBitmap
& bitmap2
,
92 const wxString
& shortHelpString
,
93 const wxString
& longHelpString
)
94 : wxToolBarToolBase(tbar
, id
, label
, bitmap1
, bitmap2
, kind
,
95 clientData
, shortHelpString
, longHelpString
)
100 wxToolBarTool(wxToolBar
*tbar
, wxControl
*control
, const wxString
& label
)
101 : wxToolBarToolBase(tbar
, control
, label
)
104 // Hold a reference to keep control alive until DoInsertTool() is
105 // called, or if RemoveTool() is called (see DoDeleteTool)
106 g_object_ref(control
->m_widget
);
107 // release reference when gtk_widget_destroy() is called on control
109 control
->m_widget
, "destroy", G_CALLBACK(g_object_unref
), NULL
);
112 // is this a radio button?
114 // unlike GetKind(), can be called for any kind of tools, not just buttons
115 bool IsRadio() const { return IsButton() && GetKind() == wxITEM_RADIO
; }
117 // this is only called for the normal buttons, i.e. not separators nor
119 GtkToolbarChildType
GetGtkChildType() const
124 return GTK_TOOLBAR_CHILD_TOGGLEBUTTON
;
127 return GTK_TOOLBAR_CHILD_RADIOBUTTON
;
130 wxFAIL_MSG( _T("unknown toolbar child type") );
133 case wxITEM_DROPDOWN
:
135 return GTK_TOOLBAR_CHILD_BUTTON
;
139 void SetImage(const wxBitmap
& bitmap
)
143 // setting from pixmap doesn't seem to work right, but pixbuf works well
144 gtk_image_set_from_pixbuf((GtkImage
*)m_image
, bitmap
.GetPixbuf());
148 // the toolbar element for button tools or a GtkAlignment containing the
149 // control for control tools
151 // dropdown element for button tools
152 GtkWidget
*m_itemDropdown
;
154 // a GtkImage containing the image for a button-type tool, may be NULL
161 // ----------------------------------------------------------------------------
163 // ----------------------------------------------------------------------------
165 IMPLEMENT_DYNAMIC_CLASS(wxToolBar
, wxControl
)
167 // ============================================================================
169 // ============================================================================
171 //-----------------------------------------------------------------------------
172 // "clicked" (internal from gtk_toolbar)
173 //-----------------------------------------------------------------------------
176 static void gtk_toolbar_callback( GtkWidget
*widget
,
177 wxToolBarTool
*tool
)
179 wxToolBar
*tbar
= (wxToolBar
*)tool
->GetToolBar();
181 if (tbar
->m_blockEvent
) return;
183 if (g_blockEventsOnDrag
) return;
184 if (!tool
->IsEnabled()) return;
186 if (tool
->CanBeToggled())
188 if (tool
->IsRadio() &&
189 gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget
)) &&
192 // pressed an already pressed radio button
198 tool
->SetImage(tool
->GetBitmap());
200 if ( tool
->IsRadio() && !tool
->IsToggled() )
202 // radio button went up, don't report this as a wxWin event
207 if( !tbar
->OnLeftClick( tool
->GetId(), tool
->IsToggled() ) && tool
->CanBeToggled() )
212 tool
->SetImage(tool
->GetBitmap());
217 //-----------------------------------------------------------------------------
219 //-----------------------------------------------------------------------------
221 static gboolean
gtk_toolbar_tool_rclick_callback(GtkWidget
*WXUNUSED(widget
),
222 GdkEventButton
*event
,
223 wxToolBarToolBase
*tool
)
225 if (event
->button
!= 3)
228 wxToolBar
*tbar
= (wxToolBar
*)tool
->GetToolBar();
230 if (tbar
->m_blockEvent
) return TRUE
;
232 if (g_blockEventsOnDrag
) return TRUE
;
233 if (!tool
->IsEnabled()) return TRUE
;
235 tbar
->OnRightClick( tool
->GetId(), (int)event
->x
, (int)event
->y
);
241 //-----------------------------------------------------------------------------
242 // "enter_notify_event" / "leave_notify_event" from dropdown
243 //-----------------------------------------------------------------------------
246 static gint
gtk_toolbar_buddy_enter_callback( GtkWidget
*WXUNUSED(widget
),
247 GdkEventCrossing
*WXUNUSED(gdk_event
),
250 guint8 state
= GTK_WIDGET_STATE( tool
);
251 state
|= GTK_STATE_PRELIGHT
;
252 gtk_widget_set_state( tool
, (GtkStateType
) state
);
256 static gint
gtk_toolbar_buddy_leave_callback( GtkWidget
*WXUNUSED(widget
),
257 GdkEventCrossing
*WXUNUSED(gdk_event
),
260 guint8 state
= GTK_WIDGET_STATE( tool
);
261 state
&= ~GTK_STATE_PRELIGHT
;
262 gtk_widget_set_state( tool
, (GtkStateType
) state
);
267 //-----------------------------------------------------------------------------
268 // "left-click" on dropdown
269 //-----------------------------------------------------------------------------
273 static void gtk_pop_tb_hide_callback( GtkWidget
*WXUNUSED(menu
), GtkToggleButton
*button
)
275 gtk_toggle_button_set_active( button
, FALSE
);
278 static gboolean
gtk_toolbar_dropdown_lclick_callback(GtkWidget
*widget
,
279 GdkEventButton
*event
,
280 wxToolBarToolBase
*tool
)
282 if (event
->button
!= 1)
285 wxToolBar
*tbar
= (wxToolBar
*)tool
->GetToolBar();
287 if (tbar
->m_blockEvent
) return FALSE
;
289 if (g_blockEventsOnDrag
) return FALSE
;
290 if (!tool
->IsEnabled()) return FALSE
;
292 wxCommandEvent
evt(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED
, tool
->GetId() );
293 if ( tbar
->HandleWindowEvent(evt
) )
298 wxMenu
* const menu
= tool
->GetDropdownMenu();
303 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(widget
), TRUE
);
305 g_signal_connect (menu
->m_menu
, "hide",
306 G_CALLBACK (gtk_pop_tb_hide_callback
),
309 tbar
->PopupMenu( menu
, widget
->allocation
.x
,
310 widget
->allocation
.y
+ widget
->allocation
.height
);
317 //-----------------------------------------------------------------------------
318 // "enter_notify_event" / "leave_notify_event"
319 //-----------------------------------------------------------------------------
322 static gint
gtk_toolbar_tool_callback( GtkWidget
*WXUNUSED(widget
),
323 GdkEventCrossing
*gdk_event
,
324 wxToolBarTool
*tool
)
326 if (g_blockEventsOnDrag
) return TRUE
;
328 wxToolBar
*tb
= (wxToolBar
*)tool
->GetToolBar();
331 if( gdk_event
->type
== GDK_ENTER_NOTIFY
)
332 tb
->OnMouseEnter( tool
->GetId() );
334 tb
->OnMouseEnter( -1 );
340 //-----------------------------------------------------------------------------
341 // "size_request" from m_toolbar
342 //-----------------------------------------------------------------------------
346 size_request(GtkWidget
*, GtkRequisition
* req
, wxToolBar
* win
)
348 const wxSize margins
= win
->GetMargins();
349 req
->width
+= margins
.x
;
350 req
->height
+= 2 * margins
.y
;
354 //-----------------------------------------------------------------------------
355 // InsertChild callback for wxToolBar
356 //-----------------------------------------------------------------------------
358 static void wxInsertChildInToolBar( wxWindow
* WXUNUSED(parent
),
359 wxWindow
* /* child */)
361 // Child widget will be inserted into GtkToolbar by DoInsertTool()
364 // ----------------------------------------------------------------------------
366 // ----------------------------------------------------------------------------
368 void wxToolBarTool::Init()
375 wxToolBarToolBase
*wxToolBar::CreateTool(int id
,
376 const wxString
& text
,
377 const wxBitmap
& bitmap1
,
378 const wxBitmap
& bitmap2
,
380 wxObject
*clientData
,
381 const wxString
& shortHelpString
,
382 const wxString
& longHelpString
)
384 return new wxToolBarTool(this, id
, text
, bitmap1
, bitmap2
, kind
,
385 clientData
, shortHelpString
, longHelpString
);
389 wxToolBar::CreateTool(wxControl
*control
, const wxString
& label
)
391 return new wxToolBarTool(this, control
, label
);
394 //-----------------------------------------------------------------------------
395 // wxToolBar construction
396 //-----------------------------------------------------------------------------
398 void wxToolBar::Init()
400 m_toolbar
= (GtkToolbar
*)NULL
;
401 m_blockEvent
= false;
403 m_defaultHeight
= 32;
406 wxToolBar::~wxToolBar()
410 bool wxToolBar::Create( wxWindow
*parent
,
415 const wxString
& name
)
417 m_insertCallback
= wxInsertChildInToolBar
;
419 if ( !PreCreation( parent
, pos
, size
) ||
420 !CreateBase( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
))
422 wxFAIL_MSG( wxT("wxToolBar creation failed") );
429 m_toolbar
= GTK_TOOLBAR( gtk_toolbar_new() );
432 // Doesn't work this way.
433 // GtkToolbarSpaceStyle space_style = GTK_TOOLBAR_SPACE_EMPTY;
434 // gtk_widget_style_set (GTK_WIDGET (m_toolbar), "space_style", &space_style, NULL);
436 SetToolSeparation(7);
438 if (style
& wxTB_DOCKABLE
)
440 m_widget
= gtk_handle_box_new();
441 gtk_container_add( GTK_CONTAINER(m_widget
), GTK_WIDGET(m_toolbar
) );
442 gtk_widget_show( GTK_WIDGET(m_toolbar
) );
444 if (style
& wxTB_FLAT
)
445 gtk_handle_box_set_shadow_type( GTK_HANDLE_BOX(m_widget
), GTK_SHADOW_NONE
);
449 m_widget
= gtk_event_box_new();
450 gtk_container_add( GTK_CONTAINER(m_widget
), GTK_WIDGET(m_toolbar
) );
451 ConnectWidget( m_widget
);
452 gtk_widget_show(GTK_WIDGET(m_toolbar
));
455 // FIXME: there is no such function for toolbars in 2.0
457 if (style
& wxTB_FLAT
)
458 gtk_toolbar_set_button_relief( GTK_TOOLBAR(m_toolbar
), GTK_RELIEF_NONE
);
461 m_parent
->DoAddChild( this );
465 g_signal_connect_after(m_toolbar
, "size_request",
466 G_CALLBACK(size_request
), this);
471 GdkWindow
*wxToolBar::GTKGetWindow(wxArrayGdkWindows
& WXUNUSED(windows
)) const
473 return GTK_WIDGET(m_toolbar
)->window
;
476 void wxToolBar::GtkSetStyle()
478 GtkOrientation orient
;
479 GtkToolbarStyle style
;
480 GetGtkStyle(GetWindowStyle(), &orient
, &style
);
482 gtk_toolbar_set_orientation(m_toolbar
, orient
);
483 gtk_toolbar_set_style(m_toolbar
, style
);
484 gtk_toolbar_set_tooltips(m_toolbar
, !(style
& wxTB_NO_TOOLTIPS
));
487 void wxToolBar::SetWindowStyleFlag( long style
)
489 wxToolBarBase::SetWindowStyleFlag(style
);
495 bool wxToolBar::DoInsertTool(size_t pos
, wxToolBarToolBase
*toolBase
)
497 wxToolBarTool
* tool
= wx_static_cast(wxToolBarTool
*, toolBase
);
499 if ( tool
->IsButton() )
501 if ( !HasFlag(wxTB_NOICONS
) )
503 wxBitmap bitmap
= tool
->GetNormalBitmap();
505 wxCHECK_MSG( bitmap
.Ok(), false,
506 wxT("invalid bitmap for wxToolBar icon") );
508 tool
->m_image
= gtk_image_new();
509 tool
->SetImage(bitmap
);
511 gtk_misc_set_alignment((GtkMisc
*)tool
->m_image
, 0.5, 0.5);
518 for ( size_t i
= 0; i
< pos
; i
++ )
522 // if we have a dropdown menu, we use 2 GTK tools internally
523 wxToolBarToolsList::compatibility_iterator node
= m_tools
.Item( i
);
524 wxToolBarTool
* const tool2
= (wxToolBarTool
*) node
->GetData();
525 if ( tool2
->IsButton() && tool2
->GetKind() == wxITEM_DROPDOWN
)
531 switch ( tool
->GetStyle() )
533 case wxTOOL_STYLE_BUTTON
:
534 // for a radio button we need the widget which starts the radio
535 // group it belongs to, i.e. the first radio button immediately
536 // preceding this one
538 GtkWidget
*widget
= NULL
;
540 if ( tool
->IsRadio() )
542 wxToolBarToolsList::compatibility_iterator node
543 = wxToolBarToolsList::compatibility_iterator();
545 node
= m_tools
.Item(pos
- 1);
549 wxToolBarTool
*toolNext
= (wxToolBarTool
*)node
->GetData();
550 if ( !toolNext
->IsRadio() )
553 widget
= toolNext
->m_item
;
555 node
= node
->GetPrevious();
560 // this is the first button in the radio button group,
561 // it will be toggled automatically by GTK so bring the
562 // internal flag in sync
567 tool
->m_item
= gtk_toolbar_insert_element
570 tool
->GetGtkChildType(),
572 tool
->GetLabel().empty()
574 : (const char*) wxGTK_CONV( tool
->GetLabel() ),
575 tool
->GetShortHelp().empty()
577 : (const char*) wxGTK_CONV( tool
->GetShortHelp() ),
578 "", // tooltip_private_text (?)
580 (GtkSignalFunc
)gtk_toolbar_callback
,
585 wxCHECK_MSG(tool
->m_item
!= NULL
, false, _T("gtk_toolbar_insert_element() failed"));
587 g_signal_connect (tool
->m_item
, "enter_notify_event",
588 G_CALLBACK (gtk_toolbar_tool_callback
),
590 g_signal_connect (tool
->m_item
, "leave_notify_event",
591 G_CALLBACK (gtk_toolbar_tool_callback
),
593 g_signal_connect(tool
->m_item
, "button-press-event",
594 G_CALLBACK (gtk_toolbar_tool_rclick_callback
),
597 if (tool
->GetKind() == wxITEM_DROPDOWN
)
599 GdkPixbuf
*pixbuf
= gdk_pixbuf_new_from_xpm_data( arrow_down_xpm
);
600 GtkWidget
*dropdown
= gtk_toggle_button_new();
601 GtkWidget
*image
= gtk_image_new_from_pixbuf( pixbuf
);
602 gtk_widget_show( image
);
603 gtk_container_add( GTK_CONTAINER(dropdown
), image
);
604 g_object_unref(pixbuf
);
606 if (GetWindowStyle() & wxTB_FLAT
)
607 gtk_button_set_relief( GTK_BUTTON(dropdown
), GTK_RELIEF_NONE
);
608 GTK_WIDGET_UNSET_FLAGS (dropdown
, GTK_CAN_FOCUS
);
609 gtk_widget_show( dropdown
);
611 g_signal_connect (dropdown
, "enter_notify_event",
612 G_CALLBACK (gtk_toolbar_buddy_enter_callback
),
614 g_signal_connect (dropdown
, "leave_notify_event",
615 G_CALLBACK (gtk_toolbar_buddy_leave_callback
),
617 g_signal_connect(dropdown
, "button-press-event",
618 G_CALLBACK (gtk_toolbar_dropdown_lclick_callback
),
622 (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(tool
->m_item
) )->size_request
)
623 (tool
->m_item
, &req
);
624 gtk_widget_set_size_request( dropdown
, -1, req
.height
);
626 gtk_toolbar_insert_widget(m_toolbar
, dropdown
, NULL
, NULL
,
628 tool
->m_itemDropdown
= dropdown
;
633 case wxTOOL_STYLE_SEPARATOR
:
634 gtk_toolbar_insert_space( m_toolbar
, posGtk
);
637 case wxTOOL_STYLE_CONTROL
:
638 GtkWidget
* const align
= gtk_alignment_new(0.5, 0.5, 0, 0);
639 gtk_widget_show(align
);
640 gtk_container_add(GTK_CONTAINER(align
),
641 tool
->GetControl()->m_widget
);
642 gtk_toolbar_insert_widget(m_toolbar
, align
, NULL
, NULL
, posGtk
);
644 // remember the container we're in so that we could remove
645 // ourselves from it when we're detached from the toolbar
646 tool
->m_item
= align
;
650 InvalidateBestSize();
655 bool wxToolBar::DoDeleteTool(size_t pos
, wxToolBarToolBase
*toolBase
)
657 wxToolBarTool
* tool
= wx_static_cast(wxToolBarTool
*, toolBase
);
659 switch ( tool
->GetStyle() )
661 case wxTOOL_STYLE_CONTROL
:
662 // don't destroy the control here as we can be called from
663 // RemoveTool() and then we need to keep the control alive;
664 // while if we're called from DeleteTool() the control will
665 // be destroyed when wxToolBarToolBase itself is deleted
666 gtk_container_remove(
667 GTK_CONTAINER(tool
->m_item
), tool
->GetControl()->m_widget
);
670 case wxTOOL_STYLE_BUTTON
:
671 gtk_widget_destroy( tool
->m_item
);
673 if (tool
->m_itemDropdown
)
675 gtk_widget_destroy(tool
->m_itemDropdown
);
676 tool
->m_itemDropdown
= NULL
;
680 case wxTOOL_STYLE_SEPARATOR
:
681 gtk_toolbar_remove_space( m_toolbar
, pos
);
685 wxFAIL_MSG( "unknown tool style" );
689 InvalidateBestSize();
693 // ----------------------------------------------------------------------------
694 // wxToolBar tools state
695 // ----------------------------------------------------------------------------
697 void wxToolBar::DoEnableTool(wxToolBarToolBase
*toolBase
, bool enable
)
699 wxToolBarTool
* tool
= wx_static_cast(wxToolBarTool
*, toolBase
);
703 gtk_widget_set_sensitive( tool
->m_item
, enable
);
707 void wxToolBar::DoToggleTool( wxToolBarToolBase
*toolBase
, bool toggle
)
709 wxToolBarTool
* tool
= wx_static_cast(wxToolBarTool
*, toolBase
);
711 GtkWidget
*item
= tool
->m_item
;
712 if ( item
&& GTK_IS_TOGGLE_BUTTON(item
) )
714 tool
->SetImage(tool
->GetBitmap());
718 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(item
), toggle
);
720 m_blockEvent
= false;
724 void wxToolBar::DoSetToggle(wxToolBarToolBase
* WXUNUSED(tool
),
725 bool WXUNUSED(toggle
))
727 // VZ: absolutely no idea about how to do it
728 wxFAIL_MSG( _T("not implemented") );
731 // ----------------------------------------------------------------------------
732 // wxToolBar geometry
733 // ----------------------------------------------------------------------------
735 wxToolBarToolBase
*wxToolBar::FindToolForPosition(wxCoord
WXUNUSED(x
),
736 wxCoord
WXUNUSED(y
)) const
738 // VZ: GTK+ doesn't seem to have such thing
739 wxFAIL_MSG( _T("wxToolBar::FindToolForPosition() not implemented") );
741 return (wxToolBarToolBase
*)NULL
;
744 void wxToolBar::SetMargins( int x
, int y
)
746 wxCHECK_RET( GetToolsCount() == 0,
747 wxT("wxToolBar::SetMargins must be called before adding tools.") );
753 void wxToolBar::SetToolSeparation( int separation
)
755 // FIXME: this function disappeared
757 gtk_toolbar_set_space_size( m_toolbar
, separation
);
760 m_toolSeparation
= separation
;
763 void wxToolBar::SetToolShortHelp( int id
, const wxString
& helpString
)
765 wxToolBarTool
* tool
= wx_static_cast(wxToolBarTool
*, FindById(id
));
769 (void)tool
->SetShortHelp(helpString
);
770 gtk_tooltips_set_tip(m_toolbar
->tooltips
, tool
->m_item
,
771 wxGTK_CONV( helpString
), "");
775 void wxToolBar::SetToolNormalBitmap( int id
, const wxBitmap
& bitmap
)
777 wxToolBarTool
* tool
= wx_static_cast(wxToolBarTool
*, FindById(id
));
780 wxCHECK_RET( tool
->IsButton(), wxT("Can only set bitmap on button tools."));
782 tool
->SetNormalBitmap(bitmap
);
783 tool
->SetImage(tool
->GetBitmap());
787 void wxToolBar::SetToolDisabledBitmap( int id
, const wxBitmap
& bitmap
)
789 wxToolBarTool
* tool
= wx_static_cast(wxToolBarTool
*, FindById(id
));
792 wxCHECK_RET( tool
->IsButton(), wxT("Can only set bitmap on button tools."));
794 tool
->SetDisabledBitmap(bitmap
);
795 tool
->SetImage(tool
->GetBitmap());
799 // ----------------------------------------------------------------------------
800 // wxToolBar idle handling
801 // ----------------------------------------------------------------------------
803 void wxToolBar::OnInternalIdle()
805 // Check if we have to show window now
806 if (GtkShowFromOnIdle()) return;
808 wxCursor cursor
= m_cursor
;
809 if (g_globalCursor
.Ok()) cursor
= g_globalCursor
;
813 /* I now set the cursor the anew in every OnInternalIdle call
814 as setting the cursor in a parent window also effects the
815 windows above so that checking for the current cursor is
818 if (HasFlag(wxTB_DOCKABLE
) && (m_widget
->window
))
820 /* if the toolbar is dockable, then m_widget stands for the
821 GtkHandleBox widget, which uses its own window so that we
822 can set the cursor for it. if the toolbar is not dockable,
823 m_widget comes from m_toolbar which uses its parent's
824 window ("windowless windows") and thus we cannot set the
826 gdk_window_set_cursor( m_widget
->window
, cursor
.GetCursor() );
829 wxToolBarToolsList::compatibility_iterator node
= m_tools
.GetFirst();
832 wxToolBarTool
*tool
= (wxToolBarTool
*)node
->GetData();
833 node
= node
->GetNext();
835 GtkWidget
*item
= tool
->m_item
;
838 GdkWindow
*window
= item
->window
;
842 gdk_window_set_cursor( window
, cursor
.GetCursor() );
848 if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen())
849 UpdateWindowUI(wxUPDATE_UI_FROMIDLE
);
853 // ----------------------------------------------------------------------------
857 wxToolBar::GetClassDefaultAttributes(wxWindowVariant
WXUNUSED(variant
))
859 return GetDefaultAttributesFromGTKWidget(gtk_toolbar_new
);
862 #endif // wxUSE_TOOLBAR_NATIVE