in derived class of Fl_Table_Row on callback of draw_cell changing value of Fl_Output but redrawing only happening on changing mouse focus
28 views
Skip to first unread message
Aditya Mudaliar
unread,
Oct 18, 2020, 2:59:20 PM10/18/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fltk.general
Hi i am using Ubuntu 18.04.5 LTS using fltk version 1.3.5 i am trying to get data from a selected cell of Fl_Table_Row,btw i have stored the data in a map trying to display the OrderId field in the Fl_Output* that is g_Fields.pOrderId which is in draw_cell of class DemoTable line no 222 in the attached file SendOrder.cpp i am using the class from Erico's Examples. its being redrawn only after i change my mouse focus to it. i have already tried
g_Fields.pOrderId->redraw(); still it doesnt work Kindly help
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fltkg...@googlegroups.com
You have to set the value of the Fl_Output in your table_cb().
Just add this to the bottom of table_cb():
// Set the "Orderid" output to the clicked on table row
string val = std::to_string(table->callback_row()); // int -> string
g_Fields.pOrderId->value(val.c_str()); // set string value
I'm assuming here the orderid == table row#.
If not, then use the callback_row() value to index the array
that has the orderid info.
Aditya Mudaliar
unread,
Oct 19, 2020, 11:48:09 AM10/19/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fltk.general
wow thanks alot its working,the only thing i also expected was to handle selection drag as well as i have set lpcDemotable->type(Fl_Table_Row::SELECT_SINGLE); only a single row.is selected the selection drag on the table doesnt call the table_cb method what might be the work around or way?
Greg Ercolano
unread,
Oct 19, 2020, 12:18:06 PM10/19/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fltkg...@googlegroups.com
On 2020-10-19 08:44, Aditya Mudaliar wrote:
> wow thanks alot its working,the only thing i also expected was to handle selection drag as well as i have set
> lpcDemotable->type(Fl_Table_Row::SELECT_SINGLE);
> only a single row.is selected
Well yes, SELECT_SINGLE only allows a single row to be selected, hence the name.
> the selection drag on the table doesnt call the table_cb method what might be the work around or way?
If you want to keep SELECT_SINGLE, but want to track a drag (FL_DRAG) without having
multiple items selected, you can overload the table's handle() method and track FL_DRAG
events, and then inquire the table for the currently selected item using any of e.g.
Those are just some; there's others. Please see the docs for both public and protected methods
that your derived class can use to get information about the selection.