Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - JohnGreek

#1
Either the dlls you shipped your application are different from the ones the application is compiled or the folder/files are messed up. Windows has UAC also, maybe worth looking this as well?
#2
Well it's 8 files, 4 headers and 4 source files.
But i will send you the suspicious lines


#3
Well, the thing is when i call destroy() on my tgui::MessageBox then i delete the class it is contained, somehow in my parent class(LoginScreen)
on the handleEvent function, this crashes when it tries to handle the event after i destroy the tgui::MessageBox:

qDebug() << "i try to handle the event :" << LoginEvent->type;
myGUI->handleEvent(*LoginEvent);
qDebug() << "i handled the event :" << LoginEvent->type;


In the class my message box is contained i pass the main sf::RenderWindow, tgui::GUI and my socket by reference.
If i delete the class the tgui::GUI is not deleted of course(also tried accesing it after the delete and it's fine) but why is this happening?
#4
Thanks for your reply.

I' m not including windows.h anywhere in my code, the only headers/libs i use in my project so far are Qt, SFML and TGUI. I guess it could be something from Qt? Anyways it gave me a bit of a headache but since i overcame it it's fine.

On the setSize,  i didn't really mention it as a problem or stopper, just noticed it :p


At the moment i am facing a quite weird situation with a SIGSEV error after a manual delete of my custom class pointer in a Qt slot. Debugger is also not working, crashes at startup on sf::PopEvent, sfml-window.dll
Is it safe to delete a custom class, inheriting from Qt (for usage of signals/slots) that contains tgui objects?
meaning manual delete.

duh..
#5
'MessageBox' in namespace 'tgui' does not name a type

Under windows - MinGW the class name tgui::MessageBox conflicts with MinGW's MessageBox Winapi defines.
The solution i tried is the following:

1. Go to winuser.h of the compiler directory and comment out the #define MessageBox __MINGW_NAME_AW(MessageBox) and #define MessageBoxEx __MINGW_NAME_AW(MessageBoxEx)


2.#undef MessageBox
#undef MessageBoxA
#undef MessageBoxW

On the project header file.


With this workaround i managed to get it working without any error-warning. Is this known or am i doing something wrong with my includes?

Also tgui::MessageBox::setSize(float,float); doesn't do anything unless it's called after
tgui::MessageBox::addButton(sf::String&);


Is this normal?
#6
Thanks for your reply.

I found the problem. It's point(2) of your reply about the configuration.

I needed (and still need :P) a fix for the GainedFocus/LostFocus on windows and i took backup of my compiler directory to try and compile SFML with CMAKE but it seems somehow i did something wrong and the git version of SFML was in my backup and compiler directory as well . I found out by checking the sf::String::substring function and it existed in the .hpp file...

I recompiled TGUI again as well just to be sure ;)

Must keep in mind not to mess with the compiler directory that much :D
#7
Hello.

I am using TGUI v0.6.5 compiled as shared lib on windows 7 - MinGW.
My IDE is QtCreator and i' m using Qt in conjunction with SFML & TGUI.

I have 3 classes, 1 is pure virtual "GameState", 2 is the "GameWindow" with the sf::RenderWindow and the sf::Event and 3 is a state( the login screen in this situation ) called "LoginScreen" which is inheriting from  "GameState".

I create a GameState pointer(currentState) and assign a new LoginScreen object on it.
Then in the GameWindow main loop i call currentState->HandleEvents, HandleLogic etc.

In my LoginScreen class i have 2 variables passed by reference, the sf::RenderWindow and the sf::Event so all the events on the main window are passed to the LoginScreen. The program crashes when there is a new event on the window at the myGUI->handleEvent(*LoginEvent); This is my LoginScreen::HandleEvent():

void LoginScreen::HandleEvents()
{
    while( LoginWindow->pollEvent(*LoginEvent) )
    {
        if (LoginEvent->type == sf::Event::Closed)
            LoginWindow->close();


        myGUI->handleEvent(*LoginEvent); <- This is where the crash occurs, tried with commenting out as well
        //QApplication::processEvents();
    }
}


I started the debugger but the only thing i get is (??) at function names and one file;
libstdc++6.dll

Like the error is coming from this..
Also, before i implemented the state machine and had only 1 class
as MainWindow the myGUI->handleEvent(*LoginEvent) was working just fine.

Any ideas?
#8
I see.
Thanks for your help ;)
#9
Thanks for your reply.

I will have to build SFML from source as well no?

duh..
#10
I have created a panel in my GUI and i set a Button as children with position (0, 0) relative to the panel
when i hover the mouse on the button i receive the event and the image changes, pressed works fine as well
but when i move the mouse while hovering outside the panel while the mouse had hover it stays on hover state. I add the button after i initialize it with tgui::Panel::add(button, "button") but when i create the button i don't set the GUI in the constructor.

Any ideas?


EDIT: Fixed on new release of TGUI v0.6.5
#11
Hello, i' m trying to use TGUI v6.4 for my game but i am stuck on something very weird.
I have a GameWindow class as a base for my test and i create the tgui::GUI object dynamically.
After this i initialize an EditBox defined in my header like this

Header:
tgui::EditBox::Ptr textBoxUsername;

Source:
textBoxUsername= tgui::EditBox::Ptr(*myGUI);


1st of all is this the correct way to do it?

If not please tell me how. Now on to the point.
After i initialize my EditBox and call this: textBoxUsername->load("widgets/Black.conf");
my windows becomes black whatever i try.

My enviroment is Windows 7
Compiler MinGW (DW)
I compiled from source through CMAKE but i set it to shared though i use SFML in my game statically. Could this be an issue?


Thanks in advance!



Edit: How stupid of me.. i just read on the forum that linkage must be the same for SFML AND TGUI
i had SFML static and TGUI dynamic..