Brett S Hallett wrote:
> I'm have managed to build a FXTable in a form, load some SQL and
> display some data therein, however I cannot figure out how to
> select and move the content of a table entry into a FXText field for
> later processing.
>
> The example FXRuby (table.rb) program appears to use Menu 'clicks' to
> manipulate FXTable data, I wish to access the field directly by
> simply clicking on the desired field -- can this be done ??
I have the feeling I'm misunderstanding your question, but I'll give it
a shot anyways ;)
When the user clicks on a table cell, the FXTable sends a SEL_COMMAND
message to its target. So for starters you'd want to catch that:
theTable.connect(SEL_COMMAND) { |sender, sel, tablePos|
... do something in response ...
}
Now, you say that you want to access the contents of this table cell and
move (copy?) them into a text field. So you might do this in the handler:
theTable.connect(SEL_COMMAND) { |sender, sel, tablePos|
tableItem = theTable.getItem(tablePos.row, tablePos.col)
aTextField.text = tableItem.text
}
Hope this helps,
Lyle
|