2

Like Normal, Busy or Text Select. I want to create a desktop Windows applcation and I need to change its icon.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366

1 Answers1

1

Piston itself doesn't directly provide functionality for changing the cursor icon. However, in some cases piston exposes the underlying window, which does provide that functionality.

For instance you mention GlutinWindow, which I assume is glutin_window::GlutinWindow from the pistoncore-glutin_window crate. It indirectly provides access to the underlying glutin::window::Window, by accessing the ctx field.

The underlying glutin::window::Window does have a set_cursor_icon() where you can specify a CursorIcon.

use glutin_window::GlutinWindow;
use glutin::window::CursorIcon;

let wnd: GlutinWindow = ...;

wnd.ctx.window().set_cursor_icon(CursorIcon::Default);
wnd.ctx.window().set_cursor_icon(CursorIcon::Wait);
wnd.ctx.window().set_cursor_icon(CursorIcon::Text);
vallentin
  • 23,478
  • 6
  • 59
  • 81