Jump to content

Recommended Posts

Posted

Hi everyone,

I have been playing around with a ugfx gui for a bit and it has been working well. Now I found the need to rewrite the text of several Textedit-widgets at runtime and ran into some problems: the text is written correctly first, but when I place the cursor in the widget to edit the newly loaded text, an unrelated text shows up. The text which shows up seems to be some buffer garbage, stuff I wrote to labels at some point. I changed the buffer involved in the writing of the textedit (now short_buffer, used for nothing else) and the text is the same (or similar).

 

Is this a bug or am I using the system wrong? I suppose using dynamic text could provide a workaround, but I thought I would ask before trying too many things.

I am working with a recent git version of ugfx and Chibios 18.2. 

Thank you for any help,

Thomas

 

The code for writing the textedit: (works fine for labels)

// write the desired to text to a buffer using a chibios print function
chsnprintf(short_buffer, 8, "%.1f", TCU.CE->T_max);
// write buffer to textedit
gwinSetText(ghTextedit_max_temperature, short_buffer, FALSE);

 

Posted

I am working with a recent git version of ugfx and Chibios 18.2. 

How recent is recent? There has been a text edit fix two months ago:  https://git.ugfx.io/uGFX/uGFX/commit/509fc7501e7bd30b1b314fc0d4838d7cdf6ac621 

 

I'm currently on the road so I can't dive into this right now. But can you reproduce it with the most minimal test case? Eg. using gwinSetText() with a simple string parameter (no runtime buffer stuff) and setting the last argument to TRUE?
So I guess the response to your "I suppose using dynamic text could provide a workaround, but I thought I would ask before trying too many things." statement is pretty much: That's exactly what I'd recommend you to try to track down the problem.

Posted

Hi Joel,

thank you for the quick answer. I actually checked the changelog the other day and did not find that fix. I now updated ugfx and - after fiddling with types and definitions for a while to get it to play nice with my chibios and the STM-HAL I use for the 469-disco-board - I found it doesnt change anything. Once I have time I will try dynamic text.

Best,

Thomas

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...