BadElvis
June 15th, 2010, 11:56
Hi,
I have this snippet of code that is supposed to open a window when FG starts (for testing purposes):
function onInit()
...
local w = Interface.openWindow("charlistW", "my_window");
w.setPosition(50,50);
w.setSize(100,150);
local s = w.createControl("stringcontrol", "my_text");
s.setStaticBounds(20, 20, 60, 20);
s.setFont("mini_name");
s.setFrame("mini_name");
end
This results in an error: Ruleset Error: No vertical anchor defined for 'my_text'. This is weird, since the position of the control should be sufficiently defined by setStaticBounds.
What am I missing here? How can i get rid of this error? The stringcontrol shows up correctly in my_window.
I have this snippet of code that is supposed to open a window when FG starts (for testing purposes):
function onInit()
...
local w = Interface.openWindow("charlistW", "my_window");
w.setPosition(50,50);
w.setSize(100,150);
local s = w.createControl("stringcontrol", "my_text");
s.setStaticBounds(20, 20, 60, 20);
s.setFont("mini_name");
s.setFrame("mini_name");
end
This results in an error: Ruleset Error: No vertical anchor defined for 'my_text'. This is weird, since the position of the control should be sufficiently defined by setStaticBounds.
What am I missing here? How can i get rid of this error? The stringcontrol shows up correctly in my_window.