[fxruby-users] Adding events to a widget

patrick.fernie at gmail.com patrick.fernie at gmail.com
Mon Jun 13 15:03:30 EDT 2005


 Hi all,
 
 I was wondering if it is possible to add events to an existing
 widget. That is to say, for example, I might want to make it so I can
 act on a SEL_ENTER object in an FXTextField. I tried the obvious of
 textfield.connect(SEL_ENTER) {...}, but, perhaps unsurprisingly, that
 message never reaches the FXTextField object (it is trapped by a
 widget higher in the widget tree?). So, is this possible? The
 alternative I had considered was getting the event in the FXWindow
 ancestor (although I suppose it would have to be a SEL_MOTION event or
 somesuch), and figuring out if the event occured within the
 FXTextField, and then sending the FXTextField a new message. This
 seems messy, however.
 
 Another question was regarding FXComboBoxes: Is it possible to
 reference the TextField and FXList objects within the ComboBox? I
 googled and found a thread mentioning this, but it didn't have a clear
 resolution. If I can't, is it relatively simple to create new widgets
 in pure Ruby? That is to say, create a new combobox widget out of an
 FXPacker, FXList, FXButton, and FXTextField?
 
 Thanks,
 Patrick


More information about the fxruby-users mailing list