def remove_window_from_process(self, process):
     """Remove the process from this window."""
     self.process_window_box.pop(process).set_name("")
     panel = process.panel
     panel.window().erase()
     self.panels.remove(panel)
     self.refresh_screen()
Exemple #2
0
 def remove_window_from_process(self, process):
     """Remove the process from this window."""
     self.process_window_box.pop(process).set_name("")
     panel = process.panel
     panel.window().erase()
     self.panels.remove(panel)
     self.refresh_screen()
Exemple #3
0
    def __init__(self, panel, hlines, vlines):
        self.panel = panel
        self.hlines = hlines - 2
        self.vlines = vlines - 2
        self.window = panel.window()

        self.panel.show()
        self.window.border(0)
        self.messages = []
def set_user_ptrs(panels):
    # Set the PANEL_DATA structures for individual panels
    for panel_i, panel in enumerate(panels):
        win = panel.window()
        y, x = win.getbegyx()
        h, w = win.getmaxyx()
        label = "Window Number {}".format(panel_i + 1)
        label_color = 1 + panel_i % 3
        panel_next = panels[(panel_i + 1) % len(panels)]
        panel.set_userptr(PanelData(x, y, w, h, label, label_color,
                                    panel_next))
Exemple #5
0
def move_sprite(panel, fromx, fromy, w, h, x, y):
    nw = panel.window().derwin(h, w, fromy, fromx)
    cutspr = curses.panel.new_panel(nw)
    cutspr.move(y, x)
    return cutspr
Exemple #6
0
         cl = odd_color
     else:
         cl = fn(fg, bg)
     cs.bkgdset(' ', curses.color_pair(cl))
 elif ptrn9.match(a):
     ar = ptrn9.match(a).groups()
     curses.curs_set(int(ar[0]))
 elif ptrn10.match(a):
     ar = ptrn10.match(a).groups()
     spr = get_sprite(ar[0])
     if not spr:
         continue
     lw = spr.window()
     scrout(lw, int(ar[1]), int(ar[2]), int(ar[3]), int(ar[4]), ar[5])
 elif ptrn12.match(a):
     panel.window().inch(1, 1)
 elif ptrn13.match(a):
     pass  # TODO copy command
 elif ptrn14.match(a):
     lnmode = int(ptrn14.match(a).groups()[0])  # 0-def, 1-2xln, 2-float
     send_win_size()
 elif ptrn16.match(a):
     output('user:client-time=' + '{0:.6f}\n'.format(time.time()))
 elif ptrn17.match(a):
     (sprname, posx, posy) = ptrn17.match(a).groups()
     (posx, posy, is_shifted) = get_screen_coords(float(posx), float(posy))
     (scrh, scrw) = cs.getmaxyx()
     spr = get_sprite(sprname)
     spr1 = get_sprite(sprname + ".+1")
     if not spr:
         continue