File: mouselab_1.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (45 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Demonstrate screen interaction using mouse variables
#
#     MOUSE_X MOUSE_Y MOUSE_KEY MOUSE_CHAR
#
# On entry, LID is the identifier for the previous label
#
#
# Loop until we see an <esc>
#
while (1) {

    if (exists("MOUSE_KEY") && MOUSE_KEY == 27) {
	break
    }

    LID = LID + 1
    set label 2 sprintf(">>> READY FOR LABEL %d <<<",LID-100) 
    set label 2 at graph .02, graph .65 tc lt (LID-100)
    replot

    #
    # Get mouse position and first character of label
    #
    pause mouse key

    if (MOUSE_KEY == 27) {
	break
    }

    LABEL = ""
    LABEL_X = MOUSE_X
    LABEL_Y = MOUSE_Y
    set label LID LABEL at LABEL_X, LABEL_Y
    replot
    #
    # Call routine that catches keystrokes one by one and
    # updates the label
    #
    load "mouselab_2.dem"
    #
    # Print out final label details
    #
    show label LID

} # end of loop waiting for <esc>