monospaced font in wxTextCtrl GTK

351 views
Skip to first unread message

aa...@meet-the-newmans.org

unread,
May 3, 2005, 11:46:52 AM5/3/05
to wx-u...@lists.wxwidgets.org
wxTextCtrl under windows comes up with a monospaced font.  Using GTK2 and wx 2.6 under Linux Red Hat it is always a variable spaced font.  As my application contains a text editor this is somewhat less than useful.
 
Is there a magic spell?  Here is my code for initializing the window:
 
    my_control = new wx_text_control(&the_parent,-1, &the_frame,"",
                         wxPoint(-1,-1), wxSize(-1,-1),
                         wxTE_MULTILINE | wxHSCROLL | wxTE_RICH2);
    my_control->SetEditable(true);
    wxFont* tmpFont = new wxFont(11,wxMODERN,wxNORMAL,wxNORMAL);
    my_control->SetFont(*tmpFont);

Vadim Zeitlin

unread,
May 4, 2005, 1:34:04 PM5/4/05
to wx-u...@lists.wxwidgets.org
[please set your word wrap to 76 or less, thank you]

On Tue, 3 May 2005 08:46:52 -0700 aa...@meet-the-newmans.org wrote:

> Is there a magic spell? Here is my code for initializing the window:
>
> my_control = new wx_text_control(&the_parent,-1, &the_frame,"",
> wxPoint(-1,-1), wxSize(-1,-1), wxTE_MULTILINE
> | wxHSCROLL | wxTE_RICH2); my_control->SetEditable(true);
> wxFont* tmpFont = new wxFont(11,wxMODERN,wxNORMAL,wxNORMAL);

wxMODERN doesn't necessarily select monospaced font, wxTELETYPE does.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/


aa...@meet-the-newmans.org

unread,
May 6, 2005, 1:14:55 AM5/6/05
to wx-u...@lists.wxwidgets.org
Tried that too. Not in wxGTK :(

I will change my app to let the user choose.

Thanks,
Aaron

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
> For additional commands, e-mail: wx-use...@lists.wxwidgets.org
>
>
>


Otto Wyss

unread,
May 6, 2005, 3:46:33 PM5/6/05
to wxWidgets-User
> > wxMODERN doesn't necessarily select monospaced font, wxTELETYPE does.
> >
wxTELETYPE doesn't select monospaced fonts under wxWidgets 2.6/GTK2
while wxWidgets 2.4.x/GTK1 does.

O. Wyss

--
Development of frame buffer drivers: http://linux-fbdev.sf.net
Sample code snippets for wxWidgets: http://wxcode.sf.net
How to build well-designed applications: http://wyoguide.sf.net
Desktop with a consistent look and feel: http://wyodesktop.sf.net

Reply all
Reply to author
Forward
0 new messages