Skip to content

Commit 74f60e1

Browse files
committed
fix blank window w/contour plot after keystroke actions
1 parent a6eb945 commit 74f60e1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

GSASII/GSASIIctrlGUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8572,7 +8572,7 @@ def OnSlider(event):
85728572
G2frame.Cmax = val
85738573
else:
85748574
G2frame.Cmin = val
8575-
obj.txt.SetValue(int(Ymax*val))
8575+
obj.txt.ChangeValue(int(Ymax*val))
85768576
updatePlot()
85778577
def OnNewVal(*args,**kwargs):
85788578
'respond when a value is placed in the min or max text box'

GSASII/GSASIIpwdplot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ def OnPlotKeyPress(event):
223223
elif event.key == 'T' and 'PWDR' in plottype:
224224
Page.plotStyle['title'] = not Page.plotStyle.get('title',True)
225225
elif event.key == 'f' and 'PWDR' in plottype: # short,full length or no tick-marks
226+
if G2frame.Contour: return
226227
Page.plotStyle['flTicks'] = (Page.plotStyle.get('flTicks',0)+1)%3
227228
elif event.key == 'x'and 'PWDR' in plottype:
228229
Page.plotStyle['exclude'] = not Page.plotStyle['exclude']
@@ -325,7 +326,8 @@ def OnPlotKeyPress(event):
325326
G2frame.Cmin = 0.0
326327
Page.plotStyle['Offset'] = [0,0]
327328
elif event.key == 'C' and 'PWDR' in plottype and G2frame.Contour:
328-
G2G.makeContourSliders(G2frame,Ymax,PlotPatterns,newPlot,plotType)
329+
#G2G.makeContourSliders(G2frame,Ymax,PlotPatterns,newPlot,plotType)
330+
G2G.makeContourSliders(G2frame,Ymax,PlotPatterns,True,plotType) # force newPlot=True, prevents blank plot on Mac
329331
elif event.key == 'c' and 'PWDR' in plottype:
330332
newPlot = True
331333
if not G2frame.Contour:
@@ -464,6 +466,7 @@ def OnPlotKeyPress(event):
464466
else:
465467
#print('no binding for key',event.key)
466468
return
469+
if G2frame.Contour: newPlot = True # needed or plot disappears, at least on Mac
467470
wx.CallAfter(PlotPatterns,G2frame,newPlot=newPlot,plotType=plottype,extraKeys=extraKeys)
468471

469472
def OnMotion(event):

0 commit comments

Comments
 (0)