Maxime Henrion <mhenr...@gmail.com> writes:

> Hello Andy,
>
>
> On Mon, 2010-10-18 at 14:06 +0800, Andy Stewart wrote: 
>> Hi Maxime,
>> 
>> Sorry for late, quite busy recently. :(
>
> No worries at all, you didn't even take two days to reply, that's
> actually what I would consider a fast reply!
>
>> Maxime Henrion <mhenr...@gmail.com> writes:
>> 
>> > Hello all,
>> >
>> >
>> > I recently had to use a CheckMenuItem object in some gtk2hs code.  I was
>> > surprised to see that the documentation doesn't contain anything on the
>> > "toggled" signal for this object.
>> >
>> > I resorted to use connectGeneric but that function is clearly very
>> > unsafe.  It seems to accept any type for the handler, and if you get it
>> > wrong, you experience stack trashing and segfaults.  In my case, trying
>> > to use a plain IO action as the handler caused crashes; reading some
>> > more code I prefixed it with "\_ ->" and it now works fine...
>> I have add "toggle" signal in darcs.
>
> Great!  I've been trying it and it works perfectly.  Thanks to this and
> another patch I'm about to send, I can get rid of all the connectGeneric
> calls in my application.
>
> I see you called it "checkMenuItemToggled", presumably because "toggled"
> was already taken by ToggleButton.  What is the rule for namespace
> clashes?  Should new code only use fully qualified names?
Yes, the rule is add module prefix before signal name to avoid conflict
with other modules, maybe it's a bit long, but better than two conflict
signal name. :)

>
>> > Furthermore, I had to also bind to the "row-activated" signal of the
>> > TreeView object.  Using onRowActivated works fine, however the
>> > documentation marks it as deprecated, and doesn't offer any replacement
>> > for it.  Supposedly, that would be:
>> >
>> >     rowActivated :: TreeViewClass self => Signal self (TreePath ->
>> > TreeViewColumn -> IO ())
>> >
>> > It seems to me that gtk2hs has moved onto using the "on" and "after"
>> > combinators for handling signals, but that it still lacks replacements
>> > for a fair number of old-style signal binding functions.
>> Yes, we move noto 'on/after' signal, make API simpler. :)
>> 
>> Unfortunately, not all old-style signal have convert to new style, Axel
>> and me quite busy recently.
>> 
>> Maxime, can you convert all old-style signals to new style if you have time?
>
> Converting all of them is unfortunately way beyond what I can do with
> respect to my free time, sorry :-(.
>
> I am willing to help though, and I will continue to send patches every
> time I encounter something that I can fix and/or improve.  One is
> actually on its way to this mailing list :-P.
Great!

>
>> Thanks for report! :)
>
> Thanks for your quick action here, and also for committing my patches in
> the other thread (the treeModelFilterSetVisibleFunc and
> treeSortableSetDefaultSortFunc bug fixes).
Please let me know if you find any bug, i will fix it as
quick as possible. :)

Cheers,

  -- Andy

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Gtk2hs-devel mailing list
Gtk2hs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtk2hs-devel

Reply via email to