Changeset 2615


Ignore:
Timestamp:
Jan 6, 2017 3:06:23 PM (5 years ago)
Author:
toby
Message:

fix for plots w/o Data Item parent

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2611 r2615  
    28062806            XY.append([Xsum,Ysum])
    28072807            self.result = [Xsum,Ysum,Wsum,YCsum,YBsum,YDsum]
     2808            # N.B. PlotXY expects the first arg to point to G2frame. In this case, we
     2809            # create a duplicate (temporary) Plot notebook window that is a child of the
     2810            # modal SumDialog dialog (self). This nicely gets deleted when the dialog is destroyed,
     2811            # but the plot window is not fully functional, at least on the Mac.
    28082812            G2plt.PlotXY(self,XY,lines=True,Title='Sum:'+self.data[-1],labelY='Intensity',)
    28092813            self.plotFrame.Show()
    2810            
    2811            
     2814                       
    28122815        def OnOk(self,event):
    28132816            if self.dataType == 'PWDR': self.OnTest(event)
  • trunk/GSASIIplot.py

    r2614 r2615  
    251251        self.lastRaisedPlotTab = label
    252252        self.RaisePageNoRefresh(Page)
    253         # save in Tabbed page the help name for the DataItem that has created the plot
    254         Page.helpKey = self.G2frame.dataFrame.helpKey
     253        # Save the help name from the DataItem that has created the plot in Tabbed page object
     254        # so we can use it in self.OnHelp().
     255        # Are there any cases where plot tabs are created that are not tied to Data Tree entries?
     256        # One example is GSASII.SumDialog, where a test plot is created. Are there others?
     257        try:
     258            Page.helpKey = self.G2frame.dataFrame.helpKey
     259        except AttributeError:
     260            Page.helpKey = 'Data tree'
    255261        return new,plotNum,Page,Plot,limits
    256262   
Note: See TracChangeset for help on using the changeset viewer.