Gérard Ménochet
2006-May-03 00:15 UTC
[fxruby-users] ComboBox and setFocus - a liltle bug and its workaround
Hi, * FXcomboBox (FXListBox) doesn''t catch properly the focus (if the list isn''t empty). If you strike the tab key, you got it. I tried something, not really tricky aComboId.children[0].setFocus() # miracle !!! that works children[0] is the texField object children[1] is the button object .......... It would be nice to have this two identifiers as Attributes ( with some warnings) in the FXComboBox (FXListBox) widgets. No need to declare a bug. For me, it seems logical to have comboBoxId.gettextFieldId().setFocus(). * I ''d like to set a selectAll() on this textField of the comboBox but unfortunately, it''s a FXWindow class. I will be glad to have some clues Thanks G?rard M?nochet -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060503/d6ad3a8b/attachment.htm
Lyle Johnson
2006-May-03 02:35 UTC
[fxruby-users] ComboBox and setFocus - a liltle bug and its workaround
On May 2, 2006, at 7:15 PM, G?rard M?nochet wrote:> ??? It would be nice to have this two identifiers as Attributes ( with > some warnings)?in the FXComboBox (FXListBox) widgets. No need? to > declare a bug. For me, it seems logical to have? > comboBoxId.gettextFieldId().setFocus().I suppose you can file a feature request if this is something that you''d like to see added in a future release, but it sounds like you''ve already solved the problem since Ruby allows you to reopen classes to add methods to them: class FXComboBox def textField; children[0]; end def button; children[1]; end end -- Lyle -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 700 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060502/8dab2d95/attachment.bin
Lyle Johnson
2006-May-04 01:47 UTC
[fxruby-users] ComboBox and setFocus - a liltle bug and its workaround
On May 2, 2006, at 7:15 PM, G?rard M?nochet wrote:> * I ''d like to set a selectAll() on this textField of the comboBox but > unfortunately, it''s a FXWindow class.Until the bug for FXComboBox#children is corrected, see if you can use this as a workaround to get the text field: textField = comboBox.first This refers to the same widget as comboBox.children[0], but it should come back with the correct type (FXTextField). -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 515 bytes Desc: not available Url : http://rubyforge.org/pipermail/fxruby-users/attachments/20060503/8a14962e/attachment.bin
Gérard Ménochet
2006-May-04 12:35 UTC
[fxruby-users] ComboBox and setFocus - a liltle bug and itsworkaround
Hi Lyle, That works !!. Thanks. You do a great job Regards G?rard M?nochet ----- Original Message ----- From: Lyle Johnson To: fxruby-users at rubyforge.org Sent: Thursday, May 04, 2006 3:47 AM Subject: Re: [fxruby-users] ComboBox and setFocus - a liltle bug and itsworkaround On May 2, 2006, at 7:15 PM, G?rard M?nochet wrote: * I ''d like to set a selectAll() on this textField of the comboBox but unfortunately, it''s a FXWindow class. Until the bug for FXComboBox#children is corrected, see if you can use this as a workaround to get the text field: textField = comboBox.first This refers to the same widget as comboBox.children[0], but it should come back with the correct type (FXTextField). ------------------------------------------------------------------------------ _______________________________________________ fxruby-users mailing list fxruby-users at rubyforge.org http://rubyforge.org/mailman/listinfo/fxruby-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20060504/d9950841/attachment-0001.htm