This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: @Override notations for member functions (e.g. onCreate on Android)
- From: Per Bothner <per at bothner dot com>
- To: Marius Kjeldahl <marius dot kjeldahl at gmail dot com>, "kawa at sourceware dot org" <kawa at sourceware dot org>
- Date: Sun, 23 Feb 2014 17:58:42 -0800
- Subject: Re: @Override notations for member functions (e.g. onCreate on Android)
- Authentication-results: sourceware.org; auth=none
- References: <CAHdMyCLTf7T0wB5y-Q7K+9MjZK3HMK6RGyXkMFWxa8=MO-ttXQ at mail dot gmail dot com> <530A49BD dot 1030809 at bothner dot com> <CAHdMyCJ0701d6o0N4uhGztJ_oPHu9TH-eFxBR3qhMWp6juprWg at mail dot gmail dot com>
On 02/23/2014 01:31 PM, Marius Kjeldahl wrote:
(compiling KawaActivity.scm to net.kjeldahl.kawatest)
KawaActivity.scm:15:26: warning - no accessible method 'add' in
android.widget.LinearLayout
It seems to compile fine, but is there any way to get rid of that
warning when constructing the LinearLayout? I realize it's related to
"magic" of setting properties, but from the warning I am not sure if
it actually found the right "setOrientation" or not. If it did find
it, it really should shut up, right?
I'm guessing the problem is not the orientation:
but the 'tv' parameter. That is needed to "add" children.
If you:
(require 'android-defs)
then that associates a ViewBuilder with android.view.View and so
ViewBuilder is used when compiling a build of a sub-class instance.
And ViewBuilder defines "addView" as a child-method-name, and so it
magically works.
As a hack the following will probably work:
(LinearLayout (this)
orientation: LinearLayout:VERTICAL
view: tv)
though if you really want to show the "low-level" way of
doing it you can add an explicit addView call.
BTW, you might not realize you can replace:
(define str (string-append "KawaActivity - "
((tv:getText):toString)
" - "
((Date):toString)))
(tv:setText str)))
by the following (not tested ...):
(tv:setText &{KawaActivity - &(tv:getText) - &(Date)})
--
--Per Bothner
per@bothner.com http://per.bothner.com/