[SOLVED] Crashing on child widgets

DudeCooper

20-01-2009 23:19:27

Hi, i was looking at creating children of windows and it seems that if i ever try to attach two objects to one window i get
Unhandled exception at 0x766542eb in MyGame.exe: Microsoft C++ exception: MyGUI::MyGUIException at memory location 0x0012ef24..

the code i am using is
MyGUI::WindowPtr window= mGUI->createWidget<MyGUI::Window>("WindowCS", MyGUI::IntCoord(10, 40, 1000, 1000), MyGUI::ALIGN_DEFAULT , "Overlapped");

MyGUI::ButtonPtr Button = window->createWidget<MyGUI::Button>("Button",10,10,50,50,MyGUI::ALIGN_DEFAULT,"Main"); MyGUI::ButtonPtr Button2 = window->createWidget<MyGUI::Button>("Button",100,100,50,50,MyGUI::ALIGN_DEFAULT,"Main");


both Button and Button 2 load up if the other one is not present but when i try add both to the window the above error comes. i thought it would be some error with names but there is no place to set individual names.

Thank you

my.name

21-01-2009 08:32:12

MyGUI::WindowPtr window= mGUI->createWidget<MyGUI::Window>("WindowCS", MyGUI::IntCoord(10, 40, 1000, 1000), MyGUI::ALIGN_DEFAULT , "Overlapped"); // >> Layer == "Overlapped" , name == "" >> ок

MyGUI::ButtonPtr Button = window->createWidget<MyGUI::Button>("Button",10,10,50,50,MyGUI::ALIGN_DEFAULT,"Main"); // >> name == "Main" >> ок
MyGUI::ButtonPtr Button2 = window->createWidget<MyGUI::Button>("Button",100,100,50,50,MyGUI::ALIGN_DEFAULT,"Main"); // >> name == "Main" >> wrong

DudeCooper

21-01-2009 10:00:17

Ah thank you. i thought that end part was telling it which one of these to use not its name,

<Layer name="Main" overlapped="false" peek="true "/>


Thank you

my.name

21-01-2009 10:04:50

=)