Michael Dzjaparidze
2014-10-17 16:37:40 UTC
I'm trying to subclass UserView, but I get a:
ERROR: Qt: Usage of QPen is not allowed at this point!
ERROR: Primitive '_QPen_StrokeColor' failed.
for the following class code
MyViewSubClass : UserView {
*new { arg parent,bounds;
bounds = bounds ? (parent.notNil.if { parent.view.bounds } { nil } ? Rect(100,300,100,20));
^super.new(parent,bounds).init;
}
init {
this.drawFunc_(this.draw)
}
draw {
Pen.strokeColor_(Color.black);
Pen.moveTo((this.bounds.right - 10)@(this.bounds.height/2 + 5));
Pen.lineTo((this.bounds.right - 20)@(this.bounds.height/2 + 5))
}
}
GUI.current returns QtGUI for me. Is this yet to be implemented or am I doing something wrong here?
ERROR: Qt: Usage of QPen is not allowed at this point!
ERROR: Primitive '_QPen_StrokeColor' failed.
for the following class code
MyViewSubClass : UserView {
*new { arg parent,bounds;
bounds = bounds ? (parent.notNil.if { parent.view.bounds } { nil } ? Rect(100,300,100,20));
^super.new(parent,bounds).init;
}
init {
this.drawFunc_(this.draw)
}
draw {
Pen.strokeColor_(Color.black);
Pen.moveTo((this.bounds.right - 10)@(this.bounds.height/2 + 5));
Pen.lineTo((this.bounds.right - 20)@(this.bounds.height/2 + 5))
}
}
GUI.current returns QtGUI for me. Is this yet to be implemented or am I doing something wrong here?