Drag & Drop Cursor

Mac OSX specific forum
wombats
Enthusiast
Enthusiast
Posts: 717
Joined: Thu Dec 29, 2011 5:03 pm

Drag & Drop Cursor

Post by wombats »

When dragging items from a TreeGadget, for example, the text of the item appears under the cursor to show it's being dragged. When dragging from a CanvasGadget, obviously there are no items for the Drag & Drop Library to use. Is there a way to show what's being set? I know I can change the cursor, but that doesn't change what's underneath the cursor.

Code: Select all

Enumeration
  #Window
  #Canvas
  #Tree
EndEnumeration

Procedure OnCanvasDragStart()
  DragPrivate(0)
  Debug "drag"
EndProcedure

Procedure OnTreeDragStart()
  DragPrivate(0)
EndProcedure

OpenWindow(#Window, 100, 100, 640, 480, "", #PB_Window_SystemMenu)

CanvasGadget(#Canvas, 10, 10, 200, 460)
TreeGadget(#Tree, 220, 10, 200, 460)

AddGadgetItem(#Tree, 0, "Item 1")

BindGadgetEvent(#Canvas, @OnCanvasDragStart(), #PB_EventType_DragStart)
BindGadgetEvent(#Tree, @OnTreeDragStart(), #PB_EventType_DragStart)

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow