Gray out graph menu item if graphs aren't available
This commit is contained in:
@@ -27,8 +27,10 @@ try:
|
||||
mpl.use('wxagg')
|
||||
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as Canvas
|
||||
from matplotlib.figure import Figure
|
||||
enabled = True
|
||||
except:
|
||||
print "Problems importing matplotlib; continuing without graphs"
|
||||
enabled = False
|
||||
|
||||
from gui.graph import Graph
|
||||
import service
|
||||
|
||||
@@ -21,6 +21,7 @@ import wx
|
||||
import bitmapLoader
|
||||
import gui.fittingView
|
||||
import gui.mainFrame
|
||||
import gui.graphFrame
|
||||
|
||||
class MainMenuBar(wx.MenuBar):
|
||||
def __init__(self):
|
||||
@@ -76,6 +77,7 @@ class MainMenuBar(wx.MenuBar):
|
||||
|
||||
graphFrameItem = wx.MenuItem(windowMenu, self.graphFrameId, "Graphs\tCTRL+G")
|
||||
graphFrameItem.SetBitmap(bitmapLoader.getBitmap("graphs_small", "icons"))
|
||||
graphFrameItem.Enable(gui.graphFrame.enabled)
|
||||
windowMenu.AppendItem(graphFrameItem)
|
||||
|
||||
#windowMenu.Append(wx.ID_PREFERENCES)
|
||||
|
||||
Reference in New Issue
Block a user