Changeset 2976 for branch


Ignore:
Timestamp:
Aug 9, 2017 9:37:03 AM (6 years ago)
Author:
toby
Message:

fix Linux bug, binding triggers on widget delete, minor fixes

Location:
branch/2frame
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIIddataGUI.py

    r2931 r2976  
    769769       
    770770    def OnSelect(event):
    771         G2frame.hist = G2frame.dataWindow.HistsInPhase[select.GetSelection()]
     771        G2frame.hist = G2frame.dataWindow.HistsInPhase[DData.select.GetSelection()]
    772772        oldFocus = wx.Window.FindFocus()
    773773        G2plt.PlotSizeStrainPO(G2frame,data,G2frame.hist)
    774774        wx.CallLater(100,RepaintHistogramInfo)
    775         wx.CallAfter(oldFocus.SetFocus)
     775        if oldFocus: wx.CallAfter(oldFocus.SetFocus)
    776776       
    777777    def RepaintHistogramInfo(Scroll=0):
     
    983983   
    984984    if DData.GetSizer():
     985        DData.select.Unbind(wx.EVT_LISTBOX)  # remove binding to avoid event on Linux
    985986        DData.GetSizer().Clear(True)
    986987    mainSizer = wx.BoxSizer(wx.VERTICAL)
     
    988989    if G2frame.hist:
    989990        topSizer = wx.FlexGridSizer(1,2,5,5)
    990         select = wx.ListBox(DData,choices=G2frame.dataWindow.HistsInPhase,
     991        DData.select = wx.ListBox(DData,choices=G2frame.dataWindow.HistsInPhase,
    991992                            style=wx.LB_SINGLE,size=(-1,120))
    992         select.SetSelection(G2frame.dataWindow.HistsInPhase.index(G2frame.hist))
    993         select.SetFirstItem(G2frame.dataWindow.HistsInPhase.index(G2frame.hist))
    994         select.Bind(wx.EVT_LISTBOX,OnSelect)
    995         topSizer.Add(select,0,WACV|wx.LEFT,5)
     993        DData.select.SetSelection(G2frame.dataWindow.HistsInPhase.index(G2frame.hist))
     994        DData.select.SetFirstItem(G2frame.dataWindow.HistsInPhase.index(G2frame.hist))
     995        DData.select.Bind(wx.EVT_LISTBOX,OnSelect)
     996        topSizer.Add(DData.select,0,WACV|wx.LEFT,5)
    996997        if any(['PWDR' in item for item in keyList]):
    997998            topSizer.Add(PlotSizer())
  • branch/2frame/GSASIIphsGUI.py

    r2964 r2976  
    985985   
    986986def SetPhaseWindow(phasePage,mainSizer=None,Scroll=0):
    987     if not mainSizer is None:
     987    if mainSizer is not None:
    988988        phasePage.SetSizer(mainSizer)
    989989    phasePage.SetAutoLayout(True)
  • branch/2frame/GSASIIplot.py

    r2975 r2976  
    36383638        rId = G2gd.GetGPXtreeItemId(G2frame,Id,'Reflection Lists')
    36393639        RefData = G2frame.GPXtree.GetItemPyData(rId)[phase]
     3640        if 'Type' not in RefData or 'RefList' not in RefData:
     3641            G2G.G2MessageBox(G2frame,'Reflection list not ready','RefData error')
     3642            return
    36403643        Type = RefData['Type']
    36413644        Refs = RefData['RefList'].T
Note: See TracChangeset for help on using the changeset viewer.