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 19, 2020  
 
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.

	If you want to select multiple rows, use type(Fl_Table_Row::SELECT_MULTI) instead.
	https://www.fltk.org/doc-1.4/classFl__Table__Row.html#ad1acf911fc639c242d65ff7d5678146a

> 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.

		current_row() -- selection cursor's current row (-1 if none)
		https://www.fltk.org/doc-1.4/classFl__Table.html#a298ac46626281813442cba3b5716b12b

		row_selected() -- Checks to see if 'row' is selected.
		https://www.fltk.org/doc-1.4/classFl__Table__Row.html#aff19cae2fe81ef59f47d2970f2275df5

		is_selected() -- See if the cell at row r and column c is selected.
		https://www.fltk.org/doc-1.4/classFl__Table.html#a7913a4f0c7db42374c1b17975a173916

	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.

-- 
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/48b03aa8-f7b8-97ed-25d1-cb1285ca9a8d%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'.