self._do_cmd( cmd_DrawOnSurface)
    def do_cmd_MakeRect(self):
        self._do_cmd( cmd_MakeRect)
    def _do_cmd( self, cmd):
        "set self.current_cmdrun, etc..."
        # do we make a new one if button pressed when one already running?? yes for now.
        self.current_cmdrun = self.Instance( cmd(world = self.ui_and_world), id(cmd) ) #e cache that expr? index ok? why cache instance?
            #old cmt: #e args? world? new object? does its super handle some? Command vs CommandRun?
    pm = current_cmdrun.property_manager
    corner_stuff = SimpleColumn( toolbar, pm)
    delegate = Overlay(
        current_cmdrun,
        DrawInCorner( corner_stuff, corner = PM_CORNER),
     )
    def _init_instance(self):
        super(whatever, self)._init_instance()
        self.do_cmd_MakeRect() # or at least set some command, preferably a "null" or "default" one
            # note that this resets the current tool state on reload -- not really desirable;
            # how was demo_ui planning to handle that? ###k
    pass

our_testexpr = whatever() 

# ==

## __register__ = ['cmd_DrawOnSurface'] #e or could be filter(func, dir()) ... ###e is calling a global function clearer? yes.

auto_register( globals()) #e or list the objects?

# end

#e more commands for one? cmenu commands? etc

# ==

##e register the types & commands [stub]

##this_module_registry = registry() #e that should also register this registry with a more global one!
##
####class _x: pass # used only for _x.__module__ in following call [e.g. 'exprs.demo_polyline']
##
##auto_register( this_module_registry, globals()) ## , _x.__module__ )

auto_register(
    globals()
)  ###e this function needs a more explicit name -- and passing the specific classnames would be better

# ==
'''say above: intercept in testmode - baremotion, update_selobj i guess
and some other selobj controls
prob no need to intercept them in selectMode itself
but i am not sure...
i could have said the same about all my other mods to it...
'''

#e also move new incr methods in controls.py to class HL

#e also say above where we get in and out of opengl xor mode, and grab eg code from cookiemode or zoom or whatever to do that
# (as helper methods in the superclass, or a mixin just for xormode drawing, which could define a swapbuffers method too)
Example #3
0
            cmd(world=self.ui_and_world),
            id(cmd))  #e cache that expr? index ok? why cache instance?
        #old cmt: #e args? world? new object? does its super handle some? Command vs CommandRun?

    pm = current_cmdrun.property_manager
    corner_stuff = SimpleColumn(toolbar, pm)
    delegate = Overlay(
        current_cmdrun,
        DrawInCorner(corner_stuff, corner=PM_CORNER),
    )

    def _init_instance(self):
        super(whatever, self)._init_instance()
        self.do_cmd_MakeRect(
        )  # or at least set some command, preferably a "null" or "default" one
        # note that this resets the current tool state on reload -- not really desirable;
        # how was demo_ui planning to handle that? ###k

    pass


our_testexpr = whatever()

# ==

## __register__ = ['cmd_DrawOnSurface'] #e or could be filter(func, dir()) ... ###e is calling a global function clearer? yes.

auto_register(globals())  #e or list the objects?

# end
    pass # end of class cmd_MakePolyline

#e more commands for one? cmenu commands? etc

# ==

##e register the types & commands [stub]


##this_module_registry = registry() #e that should also register this registry with a more global one!
##
####class _x: pass # used only for _x.__module__ in following call [e.g. 'exprs.demo_polyline']
##
##auto_register( this_module_registry, globals()) ## , _x.__module__ )

auto_register( globals()) ###e this function needs a more explicit name -- and passing the specific classnames would be better

# ==

"""
say above: intercept in testmode - baremotion, update_selobj i guess
and some other selobj controls
prob no need to intercept them in selectMode itself
but i am not sure...
i could have said the same about all my other mods to it...
"""

#e also move new incr methods in controls.py to class HL

#e also say above where we get in and out of opengl xor mode, and grab eg code from BuildCrystal_Command or zoom or whatever to do that
# (as helper methods in the superclass, or a mixin just for xormode drawing, which could define a swapbuffers method too)