Use a button that has a tree widget as a parent as the widget style
for DrawHeaderButton, as this is apparently how the gtk themes decide whether to draw a normal button or a column header button. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@47272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -97,7 +97,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
// FIXME: shouldn't we destroy these windows somewhere?
|
// FIXME: shouldn't we destroy these windows somewhere?
|
||||||
|
|
||||||
// used by DrawHeaderButton and DrawPushButton
|
// used by DrawPushButton and DrawDropArrow
|
||||||
static GtkWidget *GetButtonWidget();
|
static GtkWidget *GetButtonWidget();
|
||||||
|
|
||||||
// used by DrawTreeItemButton()
|
// used by DrawTreeItemButton()
|
||||||
@@ -105,6 +105,9 @@ private:
|
|||||||
|
|
||||||
// used by DrawCheckBox()
|
// used by DrawCheckBox()
|
||||||
static GtkWidget *GetCheckButtonWidget();
|
static GtkWidget *GetCheckButtonWidget();
|
||||||
|
|
||||||
|
// Used by DrawHeaderButton
|
||||||
|
static GtkWidget *GetHeaderButtonWidget();
|
||||||
};
|
};
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
@@ -177,6 +180,26 @@ wxRendererGTK::GetTreeWidget()
|
|||||||
return s_tree;
|
return s_tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// This one just makes a button be a child of a tree widget. This is
|
||||||
|
// apparently how gtk themes decide to draw column headers differently than
|
||||||
|
// normal buttons.
|
||||||
|
GtkWidget *
|
||||||
|
wxRendererGTK::GetHeaderButtonWidget()
|
||||||
|
{
|
||||||
|
static GtkWidget *s_button = NULL;
|
||||||
|
|
||||||
|
if ( !s_button )
|
||||||
|
{
|
||||||
|
GtkWidget* treewidget = GetTreeWidget();
|
||||||
|
s_button = gtk_button_new();
|
||||||
|
gtk_widget_set_parent( s_button, treewidget );
|
||||||
|
gtk_widget_realize( s_button );
|
||||||
|
}
|
||||||
|
|
||||||
|
return s_button;
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// list/tree controls drawing
|
// list/tree controls drawing
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -190,7 +213,7 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
|
|||||||
wxHeaderButtonParams* params)
|
wxHeaderButtonParams* params)
|
||||||
{
|
{
|
||||||
|
|
||||||
GtkWidget *button = GetButtonWidget();
|
GtkWidget *button = GetHeaderButtonWidget();
|
||||||
|
|
||||||
GdkWindow* gdk_window = dc.GetGDKWindow();
|
GdkWindow* gdk_window = dc.GetGDKWindow();
|
||||||
wxASSERT_MSG( gdk_window,
|
wxASSERT_MSG( gdk_window,
|
||||||
|
Reference in New Issue
Block a user