[SOLVED] CEGUI::PushButton::hide() and show() problem

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Salwan
Just popping in
Just popping in
Posts: 2
Joined: Sat Mar 10, 2007 21:28
Location: Egypt, Qahira
Contact:

[SOLVED] CEGUI::PushButton::hide() and show() problem

Postby Salwan » Mon Mar 12, 2007 15:37

Hi everyone, :)

I am creating a gui application using Ogre 1.2.4 and CEGUI 0.4.1. Right now, I have some sort of a simple script to create/set gui elements.

I have a number of pre-created buttons that the script can use, when I create these buttons I have to hide and disable them until a script uses them.
The problem is that I cant make these buttons visible again, I used ::show() ::activate() ::enable() ::moveToFront() and buttons are still not visible.

what could possible cause this?

Here is the button creation code:

Code: Select all

   mButtonsWindow = CEGUI::WindowManager::getSingleton().createWindow(
      (CEGUI::utf8*)"WindowsLook/FrameWindow", (CEGUI::utf8*)"RulesButtons_Window" );
   mButtonsWindow->setAreaRect( CEGUI::Rect( 0.2, 0.9, 1, 1 ) );
   mButtonsWindow->setProperty( "CloseButtonEnabled", "False" );
   mButtonsWindow->setProperty( "DragMovingEnabled", "False" );
   mButtonsWindow->setProperty( "TitlebarEnabled", "False" );
   mButtonsWindow->setProperty( "SizingEnabled", "False" );
   mButtonsWindow->setFont( mEngine->getGUIMgr()->getArialFont( 12 ) );
   mWindow->addChildWindow( mButtonsWindow );

   mButton1 = (CEGUI::PushButton*)CEGUI::WindowManager::getSingleton().createWindow(
      (CEGUI::utf8*)"WindowsLook/Button", (CEGUI::utf8*)"RulesButton1_Button" );
   mButton1->setPosition( CEGUI::Point( 0.01, 0.1 ) );
   mButton1->setSize( CEGUI::Size( 0.23f, 0.8f ) );
   mButton1->setText( "Button1" );
   mButtonsWindow->addChildWindow( mButton1 );

   mButton1->deactivate();
   mButton1->hide();


and thank you very much
Last edited by Salwan on Wed Mar 14, 2007 23:17, edited 1 time in total.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Wed Mar 14, 2007 22:04

simple question: did you already check if the buttons are visible if you never hide/deactivate them ?

Salwan
Just popping in
Just popping in
Posts: 2
Joined: Sat Mar 10, 2007 21:28
Location: Egypt, Qahira
Contact:

Solved!

Postby Salwan » Wed Mar 14, 2007 23:15

Pompei2: yes I did and they were visible. :)

I solved it, the reason is illogical and irrelevant, but I somehow think it is what caused the problem. :o
Before I call show() and activate() in the same method I had a file opened with ifstream that I forgot to close.
When I closed the file before doing any CEGUI stuff the problem disappeared and buttons hide and show works as it should be now! :?

I am not sure whether that was what fixed the problem or something else, but it was the only significant change that I made to the method that contains the show/activate.

weird...


Return to “Help”

Who is online

Users browsing this forum: No registered users and 20 guests