projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Trace module initialization and cleanup.
[wxWidgets.git]
/
src
/
gtk1
/
control.cpp
diff --git
a/src/gtk1/control.cpp
b/src/gtk1/control.cpp
index f8ea0c9dc335709e6d3f88b020528f65b7eb248b..afcd65c371cddc79074d76b6718b2854bfdc17c3 100644
(file)
--- a/
src/gtk1/control.cpp
+++ b/
src/gtk1/control.cpp
@@
-7,10
+7,6
@@
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-#pragma implementation "control.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
@@
-103,7
+99,6
@@
void wxControl::PostCreation(const wxSize& size)
// GetBestSize is called.
gtk_widget_ensure_style(m_widget);
// GetBestSize is called.
gtk_widget_ensure_style(m_widget);
- InheritAttributes();
ApplyWidgetStyle();
SetInitialBestSize(size);
}
ApplyWidgetStyle();
SetInitialBestSize(size);
}
@@
-204,7
+199,7
@@
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
if ( style && style->font_desc )
{
wxNativeFontInfo info;
if ( style && style->font_desc )
{
wxNativeFontInfo info;
- info.description =
style->font_desc;
+ info.description =
pango_font_description_copy(style->font_desc);
attr.font = wxFont(info);
}
else
attr.font = wxFont(info);
}
else
@@
-232,41
+227,50
@@
wxControl::GetDefaultAttributesFromGTKWidget(GtkWidget* widget,
//static
wxVisualAttributes
//static
wxVisualAttributes
-wxControl::GetDefaultAttributesFromGTKWidget(
GtkWidget* (*widget_new)(void)
,
+wxControl::GetDefaultAttributesFromGTKWidget(
wxGtkWidgetNew_t widget_new
,
bool useBase,
int state)
{
wxVisualAttributes attr;
bool useBase,
int state)
{
wxVisualAttributes attr;
+ // NB: we need toplevel window so that GTK+ can find the right style
+ GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GtkWidget* widget = widget_new();
GtkWidget* widget = widget_new();
+ gtk_container_add(GTK_CONTAINER(wnd), widget);
attr = GetDefaultAttributesFromGTKWidget(widget, useBase, state);
attr = GetDefaultAttributesFromGTKWidget(widget, useBase, state);
- gtk_widget_destroy(w
idget
);
+ gtk_widget_destroy(w
nd
);
return attr;
}
//static
wxVisualAttributes
return attr;
}
//static
wxVisualAttributes
-wxControl::GetDefaultAttributesFromGTKWidget(
GtkWidget* (*widget_new)(const gchar*)
,
+wxControl::GetDefaultAttributesFromGTKWidget(
wxGtkWidgetNewFromStr_t widget_new
,
bool useBase,
int state)
{
wxVisualAttributes attr;
bool useBase,
int state)
{
wxVisualAttributes attr;
+ // NB: we need toplevel window so that GTK+ can find the right style
+ GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GtkWidget* widget = widget_new("");
GtkWidget* widget = widget_new("");
+ gtk_container_add(GTK_CONTAINER(wnd), widget);
attr = GetDefaultAttributesFromGTKWidget(widget, useBase, state);
attr = GetDefaultAttributesFromGTKWidget(widget, useBase, state);
- gtk_widget_destroy(w
idget
);
+ gtk_widget_destroy(w
nd
);
return attr;
}
//static
wxVisualAttributes
return attr;
}
//static
wxVisualAttributes
-wxControl::GetDefaultAttributesFromGTKWidget(
GtkWidget* (*widget_new)(GtkAdjustment*)
,
+wxControl::GetDefaultAttributesFromGTKWidget(
wxGtkWidgetNewFromAdj_t widget_new
,
bool useBase,
int state)
{
wxVisualAttributes attr;
bool useBase,
int state)
{
wxVisualAttributes attr;
+ // NB: we need toplevel window so that GTK+ can find the right style
+ GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
GtkWidget* widget = widget_new(NULL);
GtkWidget* widget = widget_new(NULL);
+ gtk_container_add(GTK_CONTAINER(wnd), widget);
attr = GetDefaultAttributesFromGTKWidget(widget, useBase, state);
attr = GetDefaultAttributesFromGTKWidget(widget, useBase, state);
- gtk_widget_destroy(w
idget
);
+ gtk_widget_destroy(w
nd
);
return attr;
}
return attr;
}