The idea is to get some widget to do not only what it's supposed to, but also something else. For example, I would really want to hear the buzzing sound of a fly whenever I press Ctrl-z in some FXText.
- require 'fox16'
- require 'fox16/responder'
- include Fox
- class BuzzingText < FXText
- include Responder
- def initialize p
- super p
- FXMAPFUNC(SEL_KEYPRESS, 0, :onKeyPress)
- end
- def onKeyPress sender, sel, event
- super sender, sel, event
- if (event.state & CONTROLMASK != 0) and (event.code == KEY_z)
- # buzz
- end
- end
- end
No comments:
Post a Comment