public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Per Bothner <per@bothner.com>
To: Marius Kjeldahl <marius.kjeldahl@gmail.com>,
	 "kawa@sourceware.org" <kawa@sourceware.org>
Subject: Re: @Override notations for member functions (e.g. onCreate on Android)
Date: Mon, 24 Feb 2014 01:59:00 -0000	[thread overview]
Message-ID: <530AA752.5070309@bothner.com> (raw)
In-Reply-To: <CAHdMyCJ0701d6o0N4uhGztJ_oPHu9TH-eFxBR3qhMWp6juprWg@mail.gmail.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/

  parent reply	other threads:[~2014-02-24  1:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-23 13:18 Marius Kjeldahl
2014-02-23 19:19 ` Per Bothner
     [not found]   ` <CAHdMyCJ0701d6o0N4uhGztJ_oPHu9TH-eFxBR3qhMWp6juprWg@mail.gmail.com>
2014-02-23 22:05     ` Fwd: " Marius Kjeldahl
2014-02-24  1:59     ` Per Bothner [this message]
     [not found]       ` <CAHdMyCKyXoM+CMYSe+WH4BHgeRTmAbQCdnOHnErGaQ=tY5fwHw@mail.gmail.com>
2014-02-24 16:38         ` Marius Kjeldahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=530AA752.5070309@bothner.com \
    --to=per@bothner.com \
    --cc=kawa@sourceware.org \
    --cc=marius.kjeldahl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).