LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree Control text flickers when using Edit Cell? event

If you have the "Edit Cell?" event of a Tree Control in an Event Structure, when validating a cell edit, the cell text often flickers to the previous value.

 

This seems to only appear when validating by clicking somewhere else on the tree, but not when clicking outside of the tree:

 

Tree Control Flicker.gif

 

The code is as simple as this (no hidden case):

raphschru_0-1726587209788.png

 

This may be a detail, but this is frustrating for the user and does not look professional.

Is there a way around this?

 

Regards,

Raphaël.

0 Kudos
Message 1 of 4
(153 Views)

I also see the same flicker in 2018 but it goes away when I use the standard Edit Cell event, not the filter event.  I don't know the exact series of events that occur when you click off a control but essentially, the value doesn't get updated to the control immediately as it does when you click enter.  Clicking outside the control causes the control to lose focus first.  Then it reverts back to previous value (possibly while the filter event is executing) because it doesn't realize that the value has been changed yet. Then the filter event occurs, followed by the actual edit cell event. 

 

Again, this is a guess on my part (hopefully a somewhat educated guess). 😜

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 4
(129 Views)

The code below seems/looks like/is Rube-Goldberg, but it seems to get rid of the flicker, at least in 2021. I will need to try with other versions.

 

Let me know if the snippet below doesn't work for you and you need 2020 version. 2021 version attached. The false case is empty, just the boolean wired through.

 

If discard is false, then no flicker when mouse clicking empty spot in tree, if true then flickers back to original value, assume the latter is okay.

 

snip.png

 

Message 3 of 4
(62 Views)

A little cleaner and less Rube. The True Case is empty, just boolean wired through.

 

snip.png

 

PS Thanks for bringing up this topic, just noticed it in one of my programs.

0 Kudos
Message 4 of 4
(38 Views)