From: C. M. <cm...@fr...> - 2006-02-21 16:40:34
|
On Tue, Feb 21, 2006 at 07:10:13AM +0100, Michael Reinelt waxed: > But there is one thing I don't like that much: your extension of the > widget structure, especially the two new function pointers 'update' and > 'find'. > > First, I'd say that a keypad widget never has a 'draw' function. So I'd > suggest removing the update function and use w->draw instead. I've pulled the 'update' in favor of 'draw', as per your suggestion, and committed the changes to CVS. I think this is a good idea, but please let me know if the patch meets your expectations. > I'm not shure about the find call. I'd accept a generic 'widget_find()" > function, but i'm unhappy with a widget specific find() callback, > because it's very keypad-specific.... I agree, at the moment, find is very specific to keypads. > maybe we can find a cleaner way to implement this.... The problem I ran into is that the widgets were designed to be self-updating and standalone. Once they startup, there didn't seem to be a lot of ways to iterate over them and find a specific one. The timer kind of takes the widget away until quit is called on it. I looked at storing the index of the generic Widgets array in the keypad widget itself and searching that, but it was messy. I think another alternative would be coming up with some sort of new 'control'-like abstraction layer to sit alongside the 'widget' layer. That might be overkill, tho. --Chris |