<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Clay<br>
    <br>
    There is a sample that demonstrates this.&nbsp; It is labeled
    SkinnableApp.&nbsp; Take a look at it to see what it does.<br>
    <br>
    On 2/25/11 5:01 PM, Clay Fowler wrote:
    <blockquote
      cite="mid:AANLkTik+kOo5GrP6vzOK-UaW5tK5gcWhVWVbkJ_ZdR5i@mail.gmail.com"
      type="cite">Is anyone successfully using&nbsp;WindowScriptObject in
      WebView to have Javascript communicate with your C# classes in a
      MonoMac project? I'm trying to do things like this:
      <div><br>
      </div>
      <div>...</div>
      <div><br>
      </div>
      <div>webView.WindowScriptObject.SetValueForKey(new
        NativeMessageReceiver(),new NSString("NativeMessageReceiver"));</div>
      <div><br>
      </div>
      <div>...</div>
      <div><br>
      </div>
      <div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>NSString
          handleMessage(NSString messageText)</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>{</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>Console.Out.WriteLine("Got
          message from page [" + messageText + "]");</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>return
          new NSString("OK");</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
        <div><br>
        </div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>bool
          isSelectorExcludedFromWebScript(Selector s)</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>{</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>return
          false;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
      </div>
      <div><br>
      </div>
      <div>But "isSelectorExcludedFromWebScript" and "handleMessage"
        never get called.</div>
      <div><br>
      </div>
      <div>Any tips?</div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Mono-osx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mono-osx@lists.ximian.com">Mono-osx@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-osx">http://lists.ximian.com/mailman/listinfo/mono-osx</a>
</pre>
    </blockquote>
  </body>
</html>