FLTK logo

Re: [fltk.general] 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

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: 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 Greg Ercolano Oct 18, 2020  
 
On 2020-10-18 10:45, Aditya Mudaliar wrote:
> 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();

	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.

-- 
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/cb9faaf9-29e0-9485-2cd7-1d4e81aa5dfd%40seriss.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.