Changeset 4552


Ignore:
Timestamp:
Aug 21, 2020 7:41:12 AM (14 months ago)
Author:
vondreele
Message:

reinstate wx.CallAfter? for ReloadFromGPX - needed to get reload to work properly
do AddToNotebook? inside reloadFromGPX after the load
Fix mpl 3.3 bugs

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4549 r4552  
    50465046                if dlg2.ShowModal() == wx.ID_OK:
    50475047                    if refPlotUpdate: refPlotUpdate({},restore=True)
    5048                     self.reloadFromGPX
     5048                    wx.CallAfter(self.reloadFromGPX,rtext)
    50495049                else:
    50505050                    if refPlotUpdate: refPlotUpdate({},restore=True)
    5051                 self.AddToNotebook(rtext)
    50525051            finally:
    50535052                dlg2.Destroy()
     
    50555054            self.ErrorDialog('Refinement error',Msg)
    50565055           
    5057     def reloadFromGPX(self):
     5056    def reloadFromGPX(self,rtext=None):
    50585057        '''Deletes current data tree & reloads it from GPX file (after a
    50595058        refinemnt.) Done after events are completed to avoid crashes.
     5059        :param rtext str: string info from cller to be put in Notebook after reload
    50605060        '''
    50615061        self.GPXtree.DeleteChildren(self.root)
     
    50645064        self.TreeItemDelete = False  # tree has been repopulated; ignore previous deletions
    50655065        self.GPXtree.RestoreExposedItems() # reset exposed/hidden tree items
     5066        if rtext is not None:
     5067            self.AddToNotebook(rtext)
    50665068        self.ResetPlots()       
    50675069       
  • trunk/GSASIIplot.py

    r4546 r4552  
    209209timeDebug = GSASIIpath.GetConfigValue('Show_timing',False)
    210210obsInCaption = True # include the observed, calc,... items in the plot caption (PlotPatterns)
     211mplv = eval(mpl.__version__.replace('.',','))
    211212
    212213#matplotlib 2.0.x dumbed down Paired to 16 colors -
     
    332333       
    333334    def ToolBarDraw(self):
    334         mplv = eval(mpl.__version__.replace('.',','))
    335335        if mplv[0] >= 3 and mplv[1] >= 3:
    336             self.toolbar.draw_idle()
     336            self.toolbar.canvas.draw_idle()
    337337        else:
    338338            self.toolbar.draw()
     
    1056510565    legend.delay = delay*1000 # Hold time in ms for clear; 0 == forever
    1056610566    for line in legend.get_lines():
    10567         line.set_picker(4)
     10567        if mplv[0] >= 3 and mplv[1] >= 3:
     10568            line.set_pickradius(4)
     10569        else:
     10570            line.set_picker(4)
    1056810571        # bug: legend items with single markers don't seem to respond to a "pick"
    1056910572    #GSASIIpath.IPyBreak()
    1057010573    for txt in legend.get_texts():
    10571         txt.set_picker(4)
     10574        if mplv[0] >= 3 and mplv[1] >= 3:
     10575            txt.set_pickradius(4)
     10576        else:
     10577            txt.set_picker(4)
    1057210578    if new:
    1057310579        legend.figure.canvas.mpl_connect('pick_event',onLegendPick)
Note: See TracChangeset for help on using the changeset viewer.