#on:send: methods

Rob Gayvert rtg at rochester.rr.com
Wed Feb 23 01:37:08 UTC 2005


Cees de Groot wrote:

>> The menu's #appendItem: method can assign an id number and keep a  
>> private dispatch dictionary mapping id numbers to WxMenuItems. That 
>> way  you don't need all those "self onMenu: 301 send: 
>> #onMenu301To303:"  commands.
>>
> +1. The juggling of integers disturbed me as well, but not enough yet 
> to  build a general solution for it... 

My concern about the #on:send: methods is that I haven't looked at this 
whole area from a Smalltalk viewpoint. All I've done so far is 
transliterate a bunch of C++ and wxPython examples into Squeak code that 
works. Hence, you wind up with some rather weird stuff like 
#onMenu301To303:. And I'm not sure I understand all of the capabilities 
of the whole wxWidgets event model either, so I'm not sure if things 
like ranges and custom events and pluggable handlers are represented 
properly. And do we ever really need ids? They strike me as ugly, but 
there might be situations where you need them.

In short, before we go off and write gobs of code that call the existing 
methods, I think it would be worthwhile to discuss what the best model 
for Squeak would be.





More information about the Wxsqueak mailing list