Re: wxEuphoria

new topic     » goto parent     » topic index » view thread      » older message » newer message
buzzo said...

Have been unable to find a way to change text color..

See comments in the code below..

Help appreciated

When setting the text for a window, you need to use set_fore_color(). set_text_color() is for setting the color of text when you're drawing in a DC. I've changed the code below to use set_fore_color() to set the color of the static text, and created and used a wxPaintDC in the paint handler:

-- this works 
	set_back_color(HelloWin,Pink) 
-- this does not work 
	set_fore_color(SomeText,BrightWhite) 
--	set_background_mode(SomeText,wxTRANSPARENT)-- crashes 
 
	procedure onPaint_HelloWin( atom this, atom event, atom it, atom event_type ) 
		atom dc = create( wxPaintDC, this ) 
-- this works in paint event..on the StaticText only... not on wx_puts 
		set_back_color( dc, BrightRed ) 
-- this does not work here either 
		set_text_color( dc, BrightWhite) 
--		set_background_mode(HelloWin,wxTRANSPARENT)	-- this crashes ? 
		wx_puts( {this,10,20, dc}, "HelloWin, World!")	-- unable to change color 
	end procedure 

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu