MCPcopy Index your code
hub / github.com/python/cpython / rectangle

Function rectangle

Lib/curses/textpad.py:6–17  ·  view source on GitHub ↗

Draw a rectangle with corners at the provided upper-left and lower-right coordinates.

(win, uly, ulx, lry, lrx)

Source from the content-addressed store, hash-verified

4import curses.ascii
5
6def rectangle(win, uly, ulx, lry, lrx):
7 """Draw a rectangle with corners at the provided upper-left
8 and lower-right coordinates.
9 """
10 win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
11 win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
12 win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
13 win.vline(uly+1, lrx, curses.ACS_VLINE, lry - uly - 1)
14 win.addch(uly, ulx, curses.ACS_ULCORNER)
15 win.addch(uly, lrx, curses.ACS_URCORNER)
16 win.addch(lry, lrx, curses.ACS_LRCORNER)
17 win.addch(lry, ulx, curses.ACS_LLCORNER)
18
19class Textbox:
20 """Editing widget using the interior of a window object.

Callers 1

test_editboxFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_editboxFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…