Re: getting a DC with wx

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

I am trying to create an example line-break conversion program to better understand wxWidgets. I want to update a status bar. So, I use wx_puts for that. I want to print in red for errors and green for regular messages. If I have two DCs for the same control can I set one to red and the other to green and then use one for error and one for info?

Without specifying DCs I call wx_puts() on the Window but nothing appears until I obscure the window and raise it again.

procedure output_wx( sequence fmt, sequence s, integer dc ) 
    if clearStatusFlag then 
	statusText = sprintf( fmt, s ) 
    else 
        statusText &= sprintf( fmt, s ) 
    end if 
    gui:begin_drawing( statusBar ) 
    ifdef DC then 
        gui:wx_puts( {statusBar,4,4,dc}, statusText ) 
    elsedef 
        gui:wx_puts( {statusBar,4,4}, statusText ) 
    end ifdef 
    gui:end_drawing( statusBar ) 
    clearStatusFlag = statusText[$] = '\n' 
end procedure 

The event that calls everything is the drag and drop event.

Shawn Pringle

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

Search



Quick Links

User menu

Not signed in.

Misc Menu