[gtkada] Separating Custom Callback Code (Patches included)

Warren W. Gay VE3WWG ve3wwg at cogeco.ca
Wed Dec 26 16:10:00 CET 2001


Emmanuel Briot wrote:

>"Warren W. Gay VE3WWG" <ve3wwg at cogeco.ca> writes:
>
>>To make this "life cycle" more reliable, I would like to propose the following
>>change:
>>
>>In the file main_win_pkg-callbacks.adb (for example), just generate the
>>callback procedures and functions with the clause "is separate". For
>>example:
>>
>
>Interesting idea, and thanks for the patch, it might indeed interest some
>people on the list.
>However, I see several problems with this approach too:
>  - First, some people might be put off by the fact that you need so many extra
>    source files, at least with the standard GNAT naming scheme (one file per
>    callback, which for big applications means tens of files.
>
I agree that this is a "downside".

>- How do you handle changes in the profile of subprograms (for instance
>    because the user has decided that he wants to use a user_data with the
>    callback after all) ?
>    These changes are apparently completely dropped in this case. Admittedly,
>    glade/gate will generate a proper *.ads file, and the user's old version of
>    the body will not match the profile in the spec, but it requires possibly
>    quite a lot of manual modifications from the user.
>
>regards
>Emmanuel
>
I hadn't considered this, but as you've pointed out, it will be caught 
by the spec
file change. The number of times this occurs, is probably much less than 
I've
had to go back and re-tweak my original custom code. For me at least, it 
seems
a more reasonable compromise.

Warren.





More information about the gtkada mailing list