Error in Object [message #46078] |
Thu, 03 November 2005 01:34 |
IDLmastertobe
Messages: 54 Registered: June 2004
|
Member |
|
|
Hi, i am trying to set property of a IDLgrView, but i received an error.
The code is as follows:
pro demo_draw, state, oWindow, oView, debug=debug
;
;Procedure DEMO_DRAW: call oWindow->Draw, oView
;wrapping the call in !except=0 if not DEBUG.
;
;On some platforms, when IDLgrWindow::Draw is invoked, math errors
;(e.g. "% Program caused arithmetic error: Floating illegal
;operand") are printed. DEMO_DRAW exists to supress the printing of
;these errors.
;
;Flush and print any accumulated math errors
;
void = check_math(/print)
;
;Silently accumulate any subsequent math errors, unless we are debugging.
;
orig_except = !except
!except = ([0, 2])[keyword_set(debug)]
;
;Draw.
;
oView->SetProperty, COLOR=[100,100,100]
oWindow->Draw, oView
;
;Silently (unless we are debugging) flush any accumulated math errors.
;
void = check_math(PRINT=keyword_set(debug))
;
;Restore original math error behavior.
;
!except = orig_except
end
oView property is something i want to change. and I received an error:
"Object reference type required in this context: OVIEW.". If instead of
having [100,100,100] as the color, i use [state.BR, state.BB, state.BG],
which are data saved in state structure, i receive another error:
"Object instance data is not visible outside class methods: STATE". Does
anyone know why? Thank you.
|
|
|