MCPcopy
hub / github.com/g3n/engine / onRicon

Method onRicon

gui/table.go:912–934  ·  view source on GitHub ↗

onRicon receives subscribed events for column header right icon

(evname string, c *tableColHeader)

Source from the content-addressed store, hash-verified

910
911// onRicon receives subscribed events for column header right icon
912func (t *Table) onRicon(evname string, c *tableColHeader) {
913
914 ico := tableSortedNoneIcon
915 var asc bool
916 if c.sorted == tableSortedNone || c.sorted == tableSortedDesc {
917 c.sorted = tableSortedAsc
918 ico = tableSortedAscIcon
919 asc = false
920 } else {
921 c.sorted = tableSortedDesc
922 ico = tableSortedDescIcon
923 asc = true
924 }
925
926 var asString bool
927 if c.sort == TableSortString {
928 asString = true
929 } else {
930 asString = false
931 }
932 t.SortColumn(c.id, asString, asc)
933 c.ricon.SetText(string(ico))
934}
935
936// findClick finds where in the table the specified mouse click event
937// occurred updating the specified TableClickEvent with the click coordinates.

Callers 1

NewTableFunction · 0.80

Calls 2

SortColumnMethod · 0.95
SetTextMethod · 0.45

Tested by

no test coverage detected