# Change the cursor style in RenderWindow

**URL:** https://discourse.vtk.org/t/change-the-cursor-style-in-renderwindow/8304
**Category:** Web
**Created:** [April 15, 2022, 1:28pm UTC](https://discourse.vtk.org/t/change-the-cursor-style-in-renderwindow/8304 "2022-04-15T13:28:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![peeling](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/p/b5e925/32.png) [@peeling](https://discourse.vtk.org/u/peeling)
#### Post date: [April 15, 2022, 1:28pm UTC](https://discourse.vtk.org/t/change-the-cursor-style-in-renderwindow/8304/1 "2022-04-15T13:28:29Z")

</div>

Hey,  
I’m using cellPicker to pick a point on a brain geometry, like in the example from vtk.js website [CellPicker](https://kitware.github.io/vtk-js/examples/CellPicker.html),  
As I’m using it on a brain geometry with a lot of triangles, the picking process takes time (2 seconds), I need to change the cursor while the picking is not yet finished, I couldn’t do that using simple css / javascript, and I couldn’t do that using the code below:

```auto
grw.getRenderWindow().getInteractor().onRightButtonPress(async (callData) => {

  grw.getRenderWindow().getInteractor().getView().setCursor('wait'); // to update the cursor to waiting status

  const pos = callData.position;
  const point = [pos.x, pos.y, 0.0];
  console.log(`Pick at: ${point}`);
  picker.pick(point, grw.getRenderer());

  const pickedCellId = picker.getCellId();
  console.log('Picked cell: ', pickedCellId);
  const pickedPoint = picker.getPickedPositions();
  const a = pickedPoint[0];
  console.log(`Picked: ${pickedPoint}`);
// *******************************************
  grw.getRenderWindow().getInteractor().getView().setCursor('pointer'); // to reset the cursor to its normal status
// ***************************************
    });
  grw.getRenderer().resetCamera();
  grw.getRenderWindow().render();

    });

```

---

<div class="post-metadata">

### Author: ![Forrest](https://discourse.vtk.org/user_avatar/discourse.vtk.org/forrest/32/300_2.png) [@Forrest](https://discourse.vtk.org/u/Forrest)
#### Post date: [April 15, 2022, 2:29pm UTC](https://discourse.vtk.org/t/change-the-cursor-style-in-renderwindow/8304/2 "2022-04-15T14:29:47Z")

</div>

I’m guessing the browser isn’t getting a chance to update the cursor because it’s blocked in the picker code. One way to verify that is to wrap just your pick code in a setTimeout with a timeout of 0, right after you set the cursor to ‘wait’.

FYI we do have pending work to select cells with hardware picking, which should speed up your picking significantly: [WIP: feat(hardwareselector): add hardware picking for point and cell ids by boucaud · Pull Request #2369 · Kitware/vtk-js · GitHub](https://github.com/Kitware/vtk-js/pull/2369)
