-
Notifications
You must be signed in to change notification settings - Fork 219
Creating Element Alias for Toggle Button - Compile Error #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@ee-boi GUIslice was written quite a long time ago in computer language age. As time passes the people who modify languages like C, C++, Java etc... are on a never ending quest to make the compilers better but also harder and harder to use... I think in this case it wants you to acknowledge that the GUIslice's
is not an int but a enum which of course it a lie since it is in fact under the covers an int. A good thing all of hard work put into C compiler support isn't going to waste... I suggest bowing to the Compiler gods and tell them you want a enum gslc_teTxtFlags like so:
If it works post so other people can benefit. |
@Pconti31 your wisdom knows no bounds! I have bowed to the (sometimes) merciful compiler gods and seem to have found a solution, albeit a slight alteration to what you posted:
swapping out
Closing this out. Once again @Pconti31 appreciate your time, wisdom and help. |
Well I may have closed this prematurely. It works...with some caveats.... Two issues I have noticed using the aliases (at least in this way)
I am thinking these two issues are related? And also could be by design? Let me know if more information needs to be shared. |
@ee-boi The guislice api is more of Calvin's area (I'm the Builder implementor). If you read over my comments from the Ignoring that lets assume you just make a call to gslc_ElemSetTxtStr() and its the alias, assuming you then reach gslc_Update() that current page is not updated with the new text? yes? that is odd... In that case I would first try to add this call right after doing the gslc_ElemeSetTxtStr()
If that doesn't work try the page the alias is sitting on (lets say for example it the Main page) and use its ENUM in the call :
As for color changes the only issue I 'm aware of is if the element you are trying to change was defined using a _P call like gslc_ElemSetTxtStr_P() since that would mean its all stored in flash and can't be modified at runtime or you are using the wrong elementref. If none of this works I'm afraid that at last you have exhausted my knowledge of guislice and will need to either abandon aliases or wait for Calvin's @ImpulseAdventure support. Paul-- |
@Pconti31 hmm neither seemed to work. The second example, as it was placed in my main.cpp file, didn't even seem to recognize the Thought I could get away with further reducing RAM usage and # of calls to more than one element update function. Oh well, I won't waste anymore time on it for now, the toggle button works fine and that is good enough for me for now. Text string updates and color changes do not work until the page is manually refreshed (i.e. switching pages back and forth). I do hope Calvin can take a look at it someday, I personally think having aliases could be useful. |
@ee-boi Once again I am willing to investigate further only if you create a sample project Even if I can't figure out a work-around it will give Calvin something to look at when he gets a chance. |
Describe the bug
I am trying to add an element alias to reuse a toggle button from one page to another. I followed the tips & tricks page instructions here, and the alias line I entered in the GUIslice.h include file is:
gslc_ElemAdd(&m_gui, E_PG_RUN2, gslc_GetElemFromRef(&m_gui, m_pElemToggle1), GSLC_ELEMREF_DEFAULT);
but I am getting the below error while compiling.
Device hardware
Expected behavior
Should compile fine? Not sure why it is complaining about an int conversion.
Initialization messages
Additional info
All help is appreciated, hopefully I am not taking advantage of your good will @Pconti31. I also have a few more issues/questions but I figured I will go one at a time for now.
The text was updated successfully, but these errors were encountered: