Main Menu

Recent posts

#51
General Discussion / showWithEffect for colapse an...
Last post by KSergeyP - 21 November 2024, 20:24:29
I looked at the router menu today)
Its submenus smoothly collapse and expand. While one collapses, another expands.
Is there a similar functionality in TGUI? For example, for TreeView
#52
Help requests / Re: Weird error after updating...
Last post by johnnywz00 - 19 November 2024, 08:36:17
Just letting you know that I have finally solved the EditBox error, and as suspected it was a result of my class structure. In this second project there is no StateManager and the GameState was getting some init called (in which the gui high scores are set up) in the Game constructor, *before* the gui's target had been set. Transposing the order of two lines fixed the problem... what an oversight! But I'm learning.
I've now got no remaining TGUI related errors and can keep happily programming away!
#53
Help requests / Re: Weird error after updating...
Last post by johnnywz00 - 17 November 2024, 09:47:22
Ah, that's it!! Thank you, and sorry that I'm so dense. I now have one TGUI project that's error-free and one project that still gets BAD ACCESS when I create EditBoxes unless I manually construct the backend. But I expect that that is a result of how my classes are structured and I am much more inspired to figure it out especially now that I know the restructuring fixed this problem.
Thanks Texus!
#54
Help requests / Re: Weird error after updating...
Last post by johnnywz00 - 17 November 2024, 09:43:58
Ah, the StateManager is indeed declared above the Gui. I will swap that now and see...
#55
Help requests / Re: Weird error after updating...
Last post by texus - 17 November 2024, 09:41:14
Is StateManager above or below the Gui in the declaration of Game?
Could you try placing the Gui object as first member in your Game object?
#56
Help requests / Re: Weird error after updating...
Last post by johnnywz00 - 17 November 2024, 09:38:31
Yes, it prints. After main() finishes, ~Game kicks in which (in this case) calls ~StateManager which calls ~PlayingState, which appears to be calling the destructor of some vector related to an EditBox or a sharedptr of EditBox... ultimately reaching unregisterFont...
The "LetterInvadersState" which you see stores a bare pointer to the Gui object which is a member of the Game class. But LetterInvaders is the class that creates and uses the EditBoxes. Would there be a difference if I constructed all the Widgets in the Game class, and only displayed them through the LetterInvaders class?
#57
Help requests / Re: Weird error after updating...
Last post by texus - 17 November 2024, 09:30:08
QuoteCould for some reason the m_registeredFonts vector be empty?
That wouldn't cause any issues. If it crashes in "Backend::unregisterFont" then it means that the backend is a nullptr and accessing m_registeredFonts is invalid.

If you print a line at the very end of your main function, does it get printed before it crashes?
I'm guessing the line gets printed and there is still some Font object that hasn't been destroyed yet.

Edit: depending on how much time you are willing to put in this, and what you really want out of the upgrade, maybe it would be better to only update to TGUI 0.8 for your existing project, which is similar enough to 0.6 while still supporting the latest SFML 2 version.
#58
Help requests / Re: Weird error after updating...
Last post by johnnywz00 - 16 November 2024, 23:35:03
Agh. My *other* project, (which didn't throw any errors creating the EditBoxes) *does* throw BAD ACCESS on exiting the program if the EditBoxes have been created. In this other project, there is a menu screen, where the EditBoxes aren't created till you enter the gameplay part. So if you open the program and quit without clicking the start game button, no error will occur. But in both programs, if the Gui creates EditBoxes, there is a bad access when the Game or GameState class destructs.
Could for some reason the m_registeredFonts vector be empty?
#59
Help requests / Re: Weird error after updating...
Last post by johnnywz00 - 16 November 2024, 20:33:26
I got the new XCode project to run. The EditBox error persists even with a fresh start. It must be something in my code structure, because as I said, I have a similar project on this computer that is running TGUI without error. The code lines that reference TGUI are identical between the two projects (it's the same  high score system), but a few of the lines are located slightly differently because the class structure is a little different. I'll examine that further.
#60
Help requests / Re: Weird error after updating...
Last post by johnnywz00 - 16 November 2024, 19:06:04
The exit error is coming from Backend::unregisterFont, coming from destructor of an EditBox. But given that this is the same XCode project that was inexplicably throwing bad access to create EditBoxes (until explicitly building the backend), maybe there's a parallel reason that the destruction is wonky. I'm going to shelve this XCode project and try to get a fresh XCode project working with a copy of the same source code files. I really suspect XCode is playing some weird tricks here. Now if only creating a fresh project wasn't giving me headaches as well...
(By the way, I hope that I don't sound like I'm grouching at *you*, because I'm not, at all... TGUI's great! Computing in general is so fraught with gotchas for a guy that has limited free time...)