diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-20 17:41:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-20 17:41:28 +0400 |
commit | 185313d90078f03044d7a7032d5ecbe61e7bd2db (patch) | |
tree | f9f9518929eba205126ca66b4295259940c2d01d /space_view3d_panel_measure.py | |
parent | 203227ce18208410ce74bbfaa1c40061a4f9fc61 (diff) |
update for api changes, note this script isnt using the API properly, it adds a draw handler but never removes it.
Diffstat (limited to 'space_view3d_panel_measure.py')
-rw-r--r-- | space_view3d_panel_measure.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/space_view3d_panel_measure.py b/space_view3d_panel_measure.py index 936a3975..6897871a 100644 --- a/space_view3d_panel_measure.py +++ b/space_view3d_panel_measure.py @@ -913,7 +913,6 @@ class VIEW3D_OT_display_measurements(bpy.types.Operator): def modal(self, context, event): context.area.tag_redraw() - return {'FINISHED'} def execute(self, context): @@ -921,17 +920,18 @@ class VIEW3D_OT_display_measurements(bpy.types.Operator): mgr_ops = context.window_manager.operators.values() if not self.bl_idname in [op.bl_idname for op in mgr_ops]: # Add the region OpenGL drawing callback - for WINregion in context.area.regions: - if WINregion.type == 'WINDOW': - self._handle = WINregion.callback_add( - draw_measurements_callback, - (self, context), - 'POST_PIXEL') - print("Measure panel display callback added") + # XXX, this is never removed!, it should be! (at least when disabling the addon) + self._handle = bpy.types.SpaceView3D.draw_handler_add( + draw_measurements_callback, + (self, context), + 'WINDOW', 'POST_PIXEL') + + print("Measure panel display callback added") - context.window_manager.modal_handler_add(self) - return {'RUNNING_MODAL'} + # XXX, never removed! + context.window_manager.modal_handler_add(self) + return {'RUNNING_MODAL'} return {'CANCELLED'} |