drag

package
v0.0.0-...-6513b37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindDraggable

func BindDraggable(dg MainDraggable, icon string, fn Swapper, draggers ...Draggable)

BindDraggable binds the draggable widget and make it drag-and-droppable. The parent MUST have its own state of children and MUST NOT rely on its container states.

This function can take additional draggers, which will override the main draggable and will be the only widgets that can be dragged away. The source ID will be taken from the main draggable.

func BindFileDest

func BindFileDest(dg Draggable, file func(path []string))

func Find

func Find(w primitives.Container, id string) int

Find searches the given container for the draggable widget with the given name.

func NewTargetEntry

func NewTargetEntry(target string, f gtk.TargetFlags, info uint) gtk.TargetEntry

Types

type Draggable

type Draggable interface {
	DragSourceSet(gdk.ModifierType, []gtk.TargetEntry, gdk.DragAction)
	DragDestSet(gtk.DestDefaults, []gtk.TargetEntry, gdk.DragAction)

	primitives.Connector
}

type MainDraggable

type MainDraggable interface {
	ID() string
	SetName(string)
	SetSensitive(bool)

	gtk.IWidget
	Draggable
}

type Swapper

type Swapper = func(targetID, movingID string)

Swapper is the type for a swap function.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL