TOPIC: uninitialized member: 0
#1602
uninitialized member: 0 10 Months, 2 Weeks ago
I have a simple control (WebBrowser):

Code:


Controller
  {
  New(url='http://google.com')
    {
    .Web.Set(url)
    }
  Controls:
    (Mshtml name: 'Web')
  }



When I just run it via the "!" button, all works fine, but when I run it from code, for instance from the WorkSpace window:

Code:


Window(WebBrowser())



I get "uninitialized member: 0". The code it's refering to is Control.Construct:

Code:


if (x[0] is 'NoPrompt' and String?(x[1]) and x[1] =~ "^[_a-z]")



Any ideas?

Jeremy
 
 
#1605
Re:uninitialized member: 0 10 Months, 2 Weeks ago
Window expects to be passed an object specifying a control/layout, where [0] is the the control.

When you run Window(WebBrowser()) you are passing Window the result of calling WebBrowser. This result does not have [0]

Try Window(Object(WebBrowser))

Note: If you do Window(#(WebBrowser)) it will look for WebBrowserControl
 
 
andrew