View Single Post
  #28  
Old 01-25-2012, 11:54 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by salesman View Post
Just tested on Testbed because I was curious:

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
// This doesn't work
  
temp.gui = new GuiWindowCtrl();
  
temp.gui.width temp.gui.height 256;
  
temp.gui.text "Test!";
  
  
// but it works if you uncomment this line:
  //GraalControl.addControl(temp.gui);

edit: I thought maybe it didn't work because the GuiControl was just destroyed as soon as the reference to temp.gui was lost (i.e. when onCreated() returns), but it didn't work if I maintained a reference either (such as with this.gui instead of temp.gui).
Yeah, that's the same thing I posted. And it makes sense too if you think about it, you can't just make it add to GraalControl by default, because what if you want to add it to another GuiControl rather than GraalControl?
Reply With Quote