[fxruby-users] Yield a message handler from another message handler?

Philippe Lang philippe.lang at attiksystem.ch
Wed May 30 02:18:28 EDT 2007

fxruby-users-bounces at rubyforge.org wrote:

> Hi,
> I'm using an FXTable as a database table interface.
> When clicking on a row header button, I'd like to know if the table
> content was changed since the last database commit. 
> I'm using the FXTable SEL_REPLACED message for that purpose. Each
> time this message is fired, I raise a "diry flag" for the table. If
> the flag is set, the table has to be commited to the database.  
> This works in most situations, except one: when the user is editing a
> cell of a fresh commited table, and then directly clicks on the row
> header, the table is still "non-dirty" when the FXHeader SEL_COMMAND
> message handler is started, and remains in this state until the
> message handler ends. Only then is the FXTable SEL_REPLACED message
> fired. But too late!     
> Is there a way to "yield" a message handler from another one? Or is
> there a workaround for that problem? 

The best workaround I found is to use the FXTable "SEL_KEYPRESS" and
"SEL_DOUBLECLICKED" message for managing the dirty flag of the table. It
works, but it is a bit excessive: the table is maked dirty in situations
where is should not, like for example when you start editing a cell, an
revert it with the ESC key.


More information about the fxruby-users mailing list