const char *txt,
size_t len)
{
- GdkFont *font = attr.HasFont() ? attr.GetFont().GetInternalFont()
- : NULL;
+ wxFont tmpFont;
+ GdkFont *font;
+ if (attr.HasFont())
+ {
+ tmpFont = attr.GetFont();
+
+ // FIXME: if this crashes because tmpFont goes out of scope and the GdkFont is
+ // deleted, then we need to call gdk_font_ref on font.
+ // This is because attr.GetFont() now returns a temporary font since wxTextAttr
+ // no longer stores a wxFont object, for efficiency.
+
+ font = tmpFont.GetInternalFont();
+ }
+ else
+ font = NULL;
GdkColor *colFg = attr.HasTextColour() ? attr.GetTextColour().GetColor()
: NULL;
extern "C" {
static void
gtk_insert_text_callback(GtkEditable *editable,
- const gchar *new_text,
- gint new_text_length,
- gint *position,
+ const gchar *WXUNUSED(new_text),
+ gint WXUNUSED(new_text_length),
+ gint *WXUNUSED(position),
wxTextCtrl *win)
{
if (g_isIdle)
extern "C" {
static void
-gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win )
+gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
if ( win->IgnoreTextUpdate() )
return;
// wxGTK-specific: called recursively by Enable,
// to give widgets an oppprtunity to correct their colours after they
// have been changed by Enable
-void wxTextCtrl::OnEnabled( bool enable )
+void wxTextCtrl::OnEnabled( bool WXUNUSED(enable) )
{
if ( IsSingleLine() )
return;