Package pyraf :: Module gkitkbase :: Class GkiInteractiveTkBase
[hide private]
[frames] | no frames]

Class GkiInteractiveTkBase

source code

    gki.GkiKernel --+
                    |
wutil.FocusEntity --+
                    |
                   GkiInteractiveTkBase

Base class for interactive graphics kernel implementation

This class implements the supporting functionality for the
interactive graphics kernel: menu bar, status line, page
caching, etc.

The actual graphics pane is implemented in a separate class,
which extends this class and must have the attributes:

makeGWidget()           Create the gwidget Tk object and colorManager object
redraw()                Redraw method (don't call this directly, used by
                        the gwidget class)
gRedraw()               Redraw that defers to gwidget
gcur()                  Wait for key to be typed and return cursor value
gcurTerminate()         Terminate active gcur so window can be destroyed
incrPlot()              Plot the stuff added to buffer since last draw
prepareToRedraw()       Prepare for complete redraw from metacode
getHistory()            Get information that needs to be saved in page history
setHistory()            Restore page using getHistory info
clearPage()             Clear page (for initialization)
startNewPage()          Setup for new page
isPageBlank()           Returns true if current page is blank
gki_*()                 Implement various GKI metacode commands

The gwidget object (created by makeGWidget) should have these
attributes (in addition to the usual Tk methods):

lastX, lastY            Last cursor position, initially None
rgbamode                Flag indicating RGB (if true) or indexed color mode
activate()              Make this the focus of plots

activateSWCursor()      Various methods for handling the crosshair cursor
deactivateSWCursor()    (Should rename and clean these up)
isSWCursorActive()
getSWCursor()

#XXX
Still need to work on the ColorManager class, which has a bunch
of OpenGL specific stuff embedded in it.  Could also probably
integrate the gl_ functions into a class and use introspection
to create the dispatch table, just like for the gki functions.
#XXX

Instance Methods [hide private]
 
__init__(self, windowName, manager) source code
 
makeStatus(self)
Make status display at bottom of window
source code
 
makeMenuBar(self)
Make menu bar at top of window
source code
 
makeFileMenu(self, menubar) source code
 
doprint(self) source code
 
save(self)
Save metacode in a file
source code
 
load(self, fname=None)
Load metacode from a file
source code
 
iconify(self) source code
 
makeEditMenu(self, menubar) source code
 
editMenuInit(self) source code
 
deletePlot(self) source code
 
deleteAllPlots(self) source code
 
makePageMenu(self, menubar) source code
 
pageMenuInit(self) source code
 
_setPageVar(self, *args)
Called when pageVar is changed (by .set() or by Page menu)
source code
 
backPage(self) source code
 
nextPage(self) source code
 
firstPage(self) source code
 
lastPage(self) source code
 
makeWindowMenu(self, menubar) source code
 
windowMenuInit(self) source code
 
createNewWindow(self) source code
 
makeHelpMenu(self, menubar) source code
 
getHelp(self)
Display window with help on graphics
source code
 
activate(self)
Make this the active window
source code
 
errorMessage(self, text)
Truncate number of error messages produced in a plot.
source code
 
flush(self)
Flush any pending graphics requests
source code
 
hasFocus(self)
Returns true if this window currently has focus
source code
 
setDrawingColor(self, irafColorIndex) source code
 
setCursorColor(self, irafColorIndex) source code
 
getWindowName(self) source code
 
gwdestroy(self)
Delete this object from the manager window list
source code
 
saveCursorPos(self)
save current position if window has focus and cursor is in window, otherwise do nothing
source code
 
forceFocus(self)
When called, the object should force focus to the window it represents and warp the cursor to it using the last saved cursor position.
source code
 
getWindowID(self)
return a window ID that can be used to find the top window of the window heirarchy.
source code
 
clear(self, name=None)
Clear the plot and start a new page
source code
 
translate(self, gkiMetacode, redraw=0) source code
 
control_openws(self, arg) source code
 
raiseWindow(self) source code
 
control_clearws(self, arg) source code
 
control_reactivatews(self, arg) source code
 
control_deactivatews(self, arg) source code
 
control_setwcs(self, arg) source code
 
gki_setwcs(self, arg) source code
 
control_getwcs(self, arg) source code
 
control_closews(self, arg) source code

Inherited from gki.GkiKernel: append, clearReturnData, control, createFunctionTables, gcur, getBuffer, getStderr, getStdin, getStdout, popStdio, prepareToRedraw, pushStdio, redoN, redrawOriginal, taskDone, taskStart, undoN

Class Variables [hide private]
  _controlOps = [gki.GKI_OPENWS, gki.GKI_CLOSEWS, gki.GKI_REACTI...
  MAX_ERROR_COUNT = 3
Method Details [hide private]

__init__(self, windowName, manager)
(Constructor)

source code 
Overrides: gki.GkiKernel.__init__

errorMessage(self, text)

source code 

Truncate number of error messages produced in a plot.

Overrides: gki.GkiKernel.errorMessage

flush(self)

source code 

Flush any pending graphics requests

Overrides: gki.GkiKernel.flush

saveCursorPos(self)

source code 

save current position if window has focus and cursor is in window, otherwise do nothing

Overrides: wutil.FocusEntity.saveCursorPos

forceFocus(self)

source code 

When called, the object should force focus to the window it represents and warp the cursor to it using the last saved cursor position.

Overrides: wutil.FocusEntity.forceFocus
(inherited documentation)

getWindowID(self)

source code 

return a window ID that can be used to find the top window of the window heirarchy.

Overrides: wutil.FocusEntity.getWindowID
(inherited documentation)

clear(self, name=None)

source code 

Clear the plot and start a new page

Overrides: gki.GkiKernel.clear

translate(self, gkiMetacode, redraw=0)

source code 
Overrides: gki.GkiKernel.translate

Class Variable Details [hide private]

_controlOps

Value:
[gki.GKI_OPENWS, gki.GKI_CLOSEWS, gki.GKI_REACTIVATEWS, gki.GKI_DEACTI\
VATEWS, gki.GKI_MFTITLE, gki.GKI_CLEARWS, gki.GKI_CANCEL, gki.GKI_FLUS\
H,]