Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7088129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:45:35+00:00 2026-05-28T07:45:35+00:00

canvas.MouseMove.Add(move canvas update) MouseMove.Add( p1 p2 p3) Usually I see this use and documentation,

  • 0
canvas.MouseMove.Add(move canvas update)

MouseMove.Add( p1 p2 p3)

Usually I see this use and documentation, two params —
(object sender, MouseEventArgs e)
— which I take to be move and canvas in this example code, taken from F#.NET Journal’s
Computational geometry: quick hull.

Is update some delagate? or routing bubble info to MouseMove.Add?

I’m just not gettng it. Any help welcome. Thanks. Art

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:45:35+00:00Added an answer on May 28, 2026 at 7:45 am

    The answer from kvb gives all the theory, so I thought I could also add a code sample. I don’t know the source of the snippet, so I’ll make some guesses based on the names – hopefully it will be useful even if it may not be completely same as the original sample.

    As kvb says, the code move canvas update is actually a function call that returns a function, which is then added as a handler to the MouseMove event.

    This means that move could be declared as follows:

    let move (canvas:Canvas) (update:unit -> unit) (me:MouseEventArgs) =
      // This function gets called when the mouse moves
      // - values me.X and me.Y give the current mouse location
      // - we can access 'canvas' that was declared when registering handler
      // - we can call 'update' to do some more work...
      // Pseudo-example:
      canvas.Children.[0].Width <- me.X
      update()
    

    When registering the event handler, the code move canvas update specifies the first two arguments of the move function, so that the handler can access canvas value that was probably declared in the place where the handler is registered (without the use of mutable variables!)

    let canvas = new Canvas() // Create canvas
    let update () = ... // some function that performs update
    
    // Register handler and give it canvas and update as first two arguments
    canvas.MouseMove.Add(move canvas update) 
    

    This should also explain why the event handler does not need to take sender:object as the first argument – you can pass the canvas (which is the sender) as a first argument using partial function application in a statically typed way (so you don’t have to cast object to Canvas).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an SVG that I will add elements to. And on mousemove this
I have a main canvas 'blackboard' in a panel, this canvas has itself several
I have this code: $('#whatever .item').each(function() { var canvas = document.getElementById('whatever'); var ctx =
mouseMove event is for moving on the canvas itself, but I can't detect when
So I want to be able to draw onto this canvas I created, let
Hello i have a canvas with the name Layout. I want to add some
I wrote a little drawing script (canvas) for this website: http://scri.ch/ When you click
I have a canvas object and I am sprinkling fantastic controls all over it.
I am using canvas in wp7 silverlight application. I am facing two problems. So
I came across this code while I was browsing for html5 canvas examples. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.