On Mon, Oct 25, 2010 at 5:24 PM, Andy Stewart <lazycat.mana...@gmail.com> wrote:
> Hi Maxime,
> Maxime Henrion <mhenr...@gmail.com> writes:
>
>>>> Finally, another question comes to mind: why is the "activate" signal
>>>> bound by the "activateLeaf" signal handler?  Should I take advantage of
>>>> this patch to rename it to just "activate", or "menuItemActivate" if
>>>> there are namespace conflicts?
>>> Yes, menuItemActivate is right signal name.
>>> But after we change to 'menuItemActivate' it conflict with function
>>> 'menu_item_activate' that emit 'activate' signal.
>>>
>>> So we change function 'menuItemActivate' (menu_item_activate) to
>>> 'menuItemEmitActivate' avoid conflict.
>>>
>>> Please see detail in patches i push. :)
>>
>> So, you actually qualified every signal handler with  the object name;
>> I thought we were only doing this in case of namespace conflicts,
>> which is why I didn't do it.  However, there's a problem in your
>> patch, as far as I can see: you have prefixed the "select", "deselect"
>> and "toggle" signals with "menuItem", while they are actually signal
>> handlers for the Item object and not the MenuItem one.  So I think
>> they should have been named "itemSelect", "itemDeselect" and
>> "itemToggle" respectively.
> We not just change signal name when it conflict with other module.
> We need add object prefix if signal name is too generic.
>
> The object prefix in signal name just a prefix to avoid conflict, not any
> sense for signal.
>
> When you use 'menuItemSelect', you can consider it's a signal 'select' in
> module 'MenuItem'

Well, this is unlike every single method in the gtk2hs source which
are all prefixed with the object name they apply to.  Naming those
signal handlers "menuItemSelect" when they actually deal with the Item
object seems dangerously misleading and a lot less logical to me, plus
it seems to violate the existing gtk2hs naming conventions.

> If we change signal to 'itemSelect', how do you handle signal name if GTK+ add
> *new* module 'Item' with same signal 'select'? :)

I don't think this could ever happen given that there already is an
existing GtkItem object.  They would have namespace conflicts on their
side before it would be a problem for us.

Cheers,
Maxime

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to