Changeset 178

Show
Ignore:
Timestamp:
08/06/2005 11:22:18 PM (3 years ago)
Author:
mwm
Message:

Turn the refernces to what used to be globals in plpwm.py in pane_utilities.py to
arguments.

Teak the plpwm.py key bindings slightly.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/plpwm.py

    r177 r178  
    11#!/usr/bin/env python 
    2 # $Id: plpwm.py,v 1.37 2005-08-07 03:18:52 mwm Exp $ 
     2# $Id: plpwm.py,v 1.38 2005-08-07 04:22:18 mwm Exp $ 
    33# 
    44# plpwm.py -- Example PLWM window manager configuration with panes. 
     
    119119    def S_M4_0(my, event): 
    120120        pane = my.wm.panes_list[my.wm.panes_current] 
    121         splitpane(pane, pane.vertical_split) 
     121        splitpane(pane, pane.vertical_split, paneWindow) 
    122122 
    123123    def M4_1(my, event): 
     
    138138    # Keystrokes for launching applications 
    139139    def M4_exclam(my, event): 
    140         runcommand(my.wm.panes_list[my.wm.panes_current]) 
     140        runcommand(my.wm.panes_list[my.wm.panes_current], paneWindow) 
    141141 
    142142    def M4_b(my, event): 
     
    161161        getapp(my.wm.panes_list[my.wm.panes_current], "J-Pilot", "jpilot") 
    162162 
    163     def M4_n(my, event): 
     163    def M4_f(my, event): 
    164164        getapp(my.wm.panes_list[my.wm.panes_current], "Mozilla", "mozilla") 
    165  
    166     def M4_s(my, event): 
    167         getapp(my.wm.panes_list[my.wm.panes_current], "SkipStone", "skipstone") 
    168165 
    169166    # Keystrokes for window manager operations 
    170167    def M4_equal(my, event): 
    171         numberpane(my.wm.panes_list[my.wm.panes_current]) 
     168        numberpane(my.wm.panes_list[my.wm.panes_current], paneWindow) 
    172169 
    173170    def M4_quoteright(my, event): 
    174         pullwindow(my.wm.panes_list[my.wm.panes_current]) 
     171        pullwindow(my.wm.panes_list[my.wm.panes_current], paneWindow) 
    175172 
    176173    def M4_quotedbl(my, event): 
    177         gotowindow(my.wm.panes_list[my.wm.panes_current]) 
     174        gotowindow(my.wm.panes_list[my.wm.panes_current], screenWindow) 
    178175 
    179176    def M4_Return(my, event): 
     
    284281class paneWindow(input.inputWindow): 
    285282    bordercolor = "Goldenrod" 
     283    editHandler = MyEditHandler 
    286284 
    287285 
     
    289287    borderwidth = 5 
    290288    bordercolor = "Orange" 
     289    editHandler = MyEditHandler 
    291290 
    292291 
  • trunk/plwm/pane_utilities.py

    r177 r178  
    11#!/usr/bin/env python 
    2 # $Id: pane_utilities.py,v 1.1 2005-08-07 03:18:53 mwm Exp $ 
     2# $Id: pane_utilities.py,v 1.2 2005-08-07 04:22:18 mwm Exp $ 
    33# 
    44# pane_utilities.py -- Utility clases and functions for use with panes 
     
    122122    "Read a string from the user, and run it." 
    123123 
    124     def __init__(my, pane, prompt = "Command: "): 
     124    def __init__(my, pane, winclass, prompt = "Command: "): 
    125125        my.system = pane.screen.system 
    126         window = paneWindow(prompt, pane.screen, length = 50) 
    127         window.read(my, MyEditHandler, pane.x, pane.y) 
     126        window = winclass(prompt, pane.screen, length = 50) 
     127        window.read(my, window.editHandler, pane.x, pane.y) 
    128128 
    129129    def __call__(my, string): 
     
    134134    "Read in a fraction, and split that much off the current pane." 
    135135 
    136     def __init__(my, pane, splitter, prompt = "Fraction: "): 
     136    def __init__(my, pane, splitter, winclass, prompt = "Fraction: "): 
    137137        my.pane, my.splitter = pane, splitter 
    138         window = paneWindow(prompt, pane.screen, length = 50) 
     138        window = winclass(prompt, pane.screen, length = 50) 
    139139        window.read(my, MyEditHandler, pane.x, pane.y) 
    140140 
     
    150150    "Read a new number for the current pane." 
    151151 
    152     def __init__(my, pane, prompt = "New number: "): 
     152    def __init__(my, pane, winclass, prompt = "New number: "): 
    153153        my.wm = pane.wm 
    154         window = paneWindow(prompt, pane.screen) 
    155         window.read(my, MyEditHandler, pane.x, pane.y) 
     154        window = winclass(prompt, pane.screen) 
     155        window.read(my, window.editHandler, pane.x, pane.y) 
    156156 
    157157    def __call__(my, name): 
     
    162162    "Read a window's name, and pull it to the current pane." 
    163163 
    164     def __init__(my, pane, prompt = "Pull: "): 
     164    def __init__(my, pane, winclass, prompt = "Pull: "): 
    165165        my.pane = pane 
    166         window = paneWindow(prompt, pane.screen) 
    167         window.read(my, MyEditHandler, pane.x, pane.y) 
     166        window = winclass(prompt, pane.screen) 
     167        window.read(my, window.editHandler, pane.x, pane.y) 
    168168 
    169169    def __call__(my, name): 
     
    179179    "Emulate the rp 'goto' command." 
    180180 
    181     def __init__(my, pane, prompt = "Goto: "): 
     181    def __init__(my, pane, winclass, prompt = "Goto: "): 
    182182        my.pane = pane 
    183         window = screenWindow(prompt, pane.screen) 
    184         window.read(my, MyEditHandler) 
     183        window = winclass(prompt, pane.screen) 
     184        window.read(my, window.editHandler) 
    185185 
    186186    def __call__(my, name):