Dirk Meyer wrote: >Comments please, I don't like to do this, but if I have to, I want to >do it right. So did I miss something?
Hi Dichi, I did not mean to propose such a drastic change. But when things start changing lots of unexpected things pop up ;-). I encountered 2 "real-world" problems when trying to build a ui for smart-playlists/albumtree, i guess the same applies to eborn and his runtime-config. I mentioned them before but I'll try to explain with examples now. M1: The readability of call/callback on menuitems menu.MenuItem(tree.name,action=self.MyCallback,arg=[list-of-my-arguments]) A beautiful solution for me would be: *arg,**kwarg instead of arg. Tough search and replace job!! A good-enough alternative would be: only use **kwargs on callback. menu.MenuItem(tree.name,action=self.MyCallback,arg=[list-of-my-arguments] ,kwargs={dict-of-my-named-arguments}) Backwards compatible. + (not a lot of work??) M2: Input windows, do not pass args back so state has to be kept in another object. By Input-Widgets/Input-Windows I really meant the following windows : Confirmbox,InputBox and Future input-windows like SelectionList,ComboBox etc. Those windows handle their own callback. Quick example inputBox(no patch just some quick pseudo-code): ----- on initialize of InputBox: def __init__(self,default-parameters,*args,**kwargs) self.callback_args = args self.callback_kwargs = kwargs ------ eventhandler of inputbox: elif event == INPUT_ENTER: if self.handler: #OLD CODE: ret = self.handler(self.value) #REPLACE WITH: ret = self.handler(self.value,*self.callback_args,**self.callback_kwargs) #END REPLACE ----- It would be easy (even for me) to patch both widgets,and document how future input windows should work. An alternative would be to just add args,kwargs parameters without the * and ** Because It would be confusing to tell what parameters are meant for input-window, and what parameters are meant for the callback. Now back to your remarks: D1:eventhandler. I agree D2:actions and it's callbacks Ahhh,actions() is also a lot like creating a menu with menu.MenuItem(), i forgot about that. It would be better to return a list of objects there indeed. And a lot of work.... What is the functional difference between a MenuItem() and an Action()? A MenuItem() is an Action() with gui? D3: No opinion(yet). Cheers, Martijn. ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r _______________________________________________ Freevo-devel mailing list Freevo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freevo-devel