Weird Refreshing Issue

I am having some weird refreshing issues as things change on the diagram. I have some questions that are based on “what if” scenarios that may be leading to them.

  1. I have GText objects at various port locations on a node. When I update the text on the GText objects does the Go “framework” do any invalidation or refresh (repaint) on the GText object?

  2. When does LayoutChildren() get called on a node? What exactly triggers it?

  3. After I have manually set locations of items in a diagram, is there anything I need to call on the View or Doc to make it paint or refresh the view?

  1. Yes. all automatic.
2. short answer: when it needs to be called. It's called when any child is added/removed/replaced or resized in a GoGroup, in OnBoundsChanged.
3. No.

Related to (3)… Is there any optimization of the visual painting done after I layout the nodes that would cause something to not be repainted? I am seeing parts of text be updated while other parts are not… or I am seeing text (that got longer) not being position adjusted for the new length.

Any calls to <SPAN =topicTitle>SuspendsUpdates (which we tell you not to do) could easily cause this. Or it can be caused by the object’s Bounds to not be in sync with how large the object really is. We’ve also seen some fonts that just have bad metrics in them that don’t work well with GoText.

how do you force the bounds in synch?

Are you using a GoText object as a GoPort.PortObject when the GoPort.Style is GoPortStyle.Object? If so, you need to make sure the GoPort.Size and the GoText.Size are the same.

If you change the size of the GoText object, such as by changing its text string or its font size, you can update the size of the GoPort itself.

Or else you’ll need to set GoText.AutoResizes to false and GoText.AutoRescales to true so that the GoText.Size stays the same but the font size adjusts so that the text will fit.

Or else you can set GoText.AutoResizes to false and GoText.Clipping to true.