Re: wxEuphoria Problems

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

Richard Egdahl wrote:
> 
> I need to change background color of a window several times during a procedure
> if possible. Something like this(though this doesn't work):
> }}}
<eucode>
> procedure change_window()
>       if seconds<60 then
>       	set_back_color( MyPanel, red )
>       end if
> end procedure
> </eucode>
{{{


Take a look at timers.  Unless this is during a long processing time?  In
that case, you might need to call refresh window, or wxApp_Yield to allow
event processing.

> AND
> 
> I want to monitor the keyboard for a certain key stroke irregardless of 
> whether the window has focus.
> This is the code I have but the window wants focus for the event to fire.
> 
> }}}
<eucode>
> procedure key_event( atom this, atom event_type, atom id, atom event )
> 	key = get_key_code(event)
> end procedure
> 
> set_event_handler( MyPanel, get_id(MyPanel), wxEVT_KEY_DOWN ,
> routine_id("key_event"))
> </eucode>
{{{


Where is the focus?  You probably need to set up a handler for wherever
the focus is, because that's where the window manager is going to send 
events.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu