Hey everyone I hope its okay to post this here, I'm having a problem with a graphics stack in C and its driving me crazy, I just want to know if I'm doing something wrong or the graphics stack itself is bugged. (this is for an embedded processor so I'm not in a windows environment).
So basically I have a label that displays text, its defined by the library as
I've written a function that when a button is pressed it takes the label as a paramater and passes it to my main which is constantly updating the text that on the label.
Code:
void UpdateLabelItem(laString str, laLabelWidget* lbl, uint32_t id)
that my function paramaters, it takes the current string stored on the label, the label itself, and a screen identifier. My problem is that I want to make a generic reference to this lbl, so in my function I set it equal to a global pointer
and I just set the 2 equal to each other, then when i'm ready to update the text I call the set text function which is defined as follows
Code:
laLabelWidget_SetText(laLabelWidget* lbl, laString str)
so i Just pass in my value as
Code:
laLabelWidget_SetText(myLabel, newString);
when I pass in my pointer myLabel it crashes, if i reference the original label, label1 it works just fine. this of course means I would have to create a function for each label which is stupid. I've tried doing a double pointer that I set up as follows
and in my function I assign it as follows
and I pass it as
Code:
iaLabelWidget_SetText(*myLabel, newString)
but that also crashes. Im a total noob when it comes to pointers in C so I figure I must be doing something wrong but I dont know whats the right direction to be going in.