Browse Source

wxwidgets 3.0: move FONT_* construction to SpectFrame

When using wxWidgets 3.0, creating a wxFont requires the gtk+
library to be initialized. This is causing espeakedit to segfault.

SpectFrame::Draw is the only place where the FONT_* variables are
used, so move them into the SpectFrame class and create them in
the constructor.

Also, FONT_NORMAL is not used so it has been removed.
master
Reece H. Dunn 11 years ago
parent
commit
fcaf5d9012
4 changed files with 6 additions and 8 deletions
  1. 0
    4
      src/espeakedit.cpp
  2. 0
    4
      src/main.h
  3. 3
    0
      src/spect.cpp
  4. 3
    0
      src/spect.h

+ 0
- 4
src/espeakedit.cpp View File



int adding_page = 0; // fix for wxWidgets (2,8,7) bug, adding first page to a wxNotebook gives emptystring for GetPageTex() in Notebook_Page_Changed event. int adding_page = 0; // fix for wxWidgets (2,8,7) bug, adding first page to a wxNotebook gives emptystring for GetPageTex() in Notebook_Page_Changed event.


wxFont FONT_SMALL(8,wxSWISS,wxNORMAL,wxNORMAL);
wxFont FONT_MEDIUM(9,wxSWISS,wxNORMAL,wxNORMAL);
wxFont FONT_NORMAL(10,wxSWISS,wxNORMAL,wxNORMAL);

IMPLEMENT_APP(MyApp) IMPLEMENT_APP(MyApp)


wxString AppName = _T("espeakedit"); wxString AppName = _T("espeakedit");

+ 0
- 4
src/main.h View File







extern wxFont FONT_SMALL;
extern wxFont FONT_MEDIUM;
extern wxFont FONT_NORMAL;

enum { enum {
MENU_QUIT = 1, MENU_QUIT = 1,
MENU_SPECTRUM, MENU_SPECTRUM,

+ 3
- 0
src/spect.cpp View File

/*************************************************************************** /***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington * * Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: [email protected] * * email: [email protected] *
* Copyright (C) 2013 by Reece H. Dunn *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *




SpectFrame::SpectFrame(SpectFrame *copy) SpectFrame::SpectFrame(SpectFrame *copy)
: FONT_SMALL(8,wxSWISS,wxNORMAL,wxNORMAL)
, FONT_MEDIUM(9,wxSWISS,wxNORMAL,wxNORMAL)
{//===================================== {//=====================================


int ix; int ix;

+ 3
- 0
src/spect.h View File

/*************************************************************************** /***************************************************************************
* Copyright (C) 2005 to 2007 by Jonathan Duddington * * Copyright (C) 2005 to 2007 by Jonathan Duddington *
* email: [email protected] * * email: [email protected] *
* Copyright (C) 2013 by Reece H. Dunn *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
private: private:
void DrawPeaks(wxDC *dc, int offy, int frame_width, int seq_amplitude, double scalex); void DrawPeaks(wxDC *dc, int offy, int frame_width, int seq_amplitude, double scalex);


wxFont FONT_SMALL;
wxFont FONT_MEDIUM;
}; };


class SpectSeq class SpectSeq

Loading…
Cancel
Save