wxEuphoria
- Posted by buzzo Jun 05, 2012
- 1348 views
Have been unable to find a way to change text color..
See comments in the code below..
Help appreciated
Buzzo
code text
-- code from several demos -- OS = win 7 include wxeud.e constant HelloFrame = create( wxFrame, {0, -1, "My First Message", -1, -1, 200, 100} ), HelloWin = create( wxPanel, {HelloFrame,-1,-1,-1,-1,-1, wxWANTS_CHARS}), SomeText = create( wxStaticText, {HelloWin,0,"Some Text", 1,1,18}), -- from demo 'text_on_window' Black = rgb( 0, 0, 0 ), Blue = rgb( 0, 0, 128 ), SkyBlue = rgb( 0, 128, 255 ), Green = rgb( 0, 128, 0 ), Cyan = rgb( 0, 128, 128 ), Red = rgb( 128, 0, 0 ), Magenta = rgb( 128, 0, 128 ), DarkBrown = rgb( 64, 64, 0 ), Brown = rgb( 128, 128, 0 ), DarkGray = rgb( 64, 64, 64 ), Gray = rgb( 128, 128, 128 ), LightGray = rgb( 192, 192, 192 ), BrightBlue = rgb( 0, 0, 255 ), BrightGreen = rgb( 0, 255, 0 ), BrightCyan = rgb( 0, 255, 255 ), BrightRed = rgb( 255, 0, 0 ), Pink = rgb( 255, 176, 176 ), BrightMagenta = rgb( 255, 0, 255 ), Purple = rgb( 208, 128, 208 ), Yellow = rgb( 255, 255, 0 ), White = rgb( 224, 224, 224 ), Parchment = rgb( 255, 255, 224 ), BrightWhite = rgb( 255, 255, 255 ) -- from demo 'bench_draw'.. this exw locks up on Win7 Home , RedPen = create( wxPen, {BrightRed, 1, wxSOLID}) , GreenPen = create( wxPen, {BrightGreen, 1, wxSOLID}) , BluePen = create( wxPen, {BrightBlue, 1, wxSOLID}) , RedBrush = create( wxBrush, {BrightRed, wxSOLID}) , GreenBrush = create( wxBrush, {BrightGreen, wxSOLID}) , TransBrush = create( wxBrush, {BrightGreen, wxTRANSPARENT}) , BlueBrush = create( wxBrush, {BrightBlue, wxSOLID}) -- this works set_back_color(HelloWin,Pink) -- this does not work set_text_color(SomeText,BrightWhite) -- set_background_mode(SomeText,wxTRANSPARENT)-- crashes procedure onPaint_HelloWin( atom this, atom event, atom it, atom event_type ) -- this works in paint event..on the StaticText only... not on wx_puts set_back_color(SomeText, BrightRed ) -- this does not work here either set_text_color(SomeText,BrightWhite) -- set_background_mode(HelloWin,wxTRANSPARENT) -- this crashes ? wx_puts( {this,10,20}, "HelloWin, World!") -- unable to change color end procedure set_event_handler( HelloWin, get_id(HelloWin), wxEVT_PAINT, routine_id( "onPaint_HelloWin" )) function rgb( integer r, integer g, integer b) return create( wxColour, {r,g,b}) end function wxMain( HelloFrame )