diff --git a/Demo_Cookbook_Browser.py b/Demo_Cookbook_Browser.py index d07e67f9..2207db3f 100644 --- a/Demo_Cookbook_Browser.py +++ b/Demo_Cookbook_Browser.py @@ -431,7 +431,10 @@ def ScriptLauncher(): def ExecuteCommandSubprocess(command, *args): try: - sp = subprocess.Popen([command,*args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + expanded_args = [] + for a in args: + expanded_args += a + sp = subprocess.Popen([command,expanded_args], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = sp.communicate() if out: print(out.decode("utf-8")) @@ -691,12 +694,12 @@ def TableSimulation(): Display data in a table format """ import PySimpleGUI as sg + sg.ChangeLookAndFeel('Dark1') layout = [[sg.T('Table Test')]] for i in range(20): - row = [sg.T(f'Row {i} ', size=(10, 1))] - layout.append([sg.T(f'{i}{j}', size=(4, 1), background_color='white', pad=(1, 1)) for j in range(10)]) + layout.append([sg.T('{} {}'.format(i,j), size=(4, 1), background_color='black', pad=(1, 1)) for j in range(10)]) sg.FlexForm('Table').LayoutAndRead(layout) diff --git a/Demo_OpenCV.py b/Demo_OpenCV.py index 9d32d465..67acba93 100644 --- a/Demo_OpenCV.py +++ b/Demo_OpenCV.py @@ -14,7 +14,8 @@ Until then enjoy it working somewhat slowly. def main(): - filename = sg.PopupGetFile('Filename to play') + filename = 'C:/Python/MIDIVideo/PlainVideos/- 08-30 Ted Talk/TED Talk Short - Video+.mp4' + # filename = sg.PopupGetFile('Filename to play') if filename is None: exit(69) vidFile = cv.VideoCapture(filename) @@ -31,7 +32,7 @@ def main(): [sg.ReadFormButton('Exit', size=(10, 2), pad=((600, 0), 3), font='Helvetica 14')]] # create the form and show it without the plot - form = sg.FlexForm('Demo Application - Embedding Matplotlib In PySimpleGUI', no_titlebar=True) + form = sg.FlexForm('Demo Application - Embedding Matplotlib In PySimpleGUI', no_titlebar=True, location=(0,0)) form.Layout(layout) form.ReadNonBlocking() diff --git a/PySimpleGUI.py b/PySimpleGUI.py index 2ce054d0..de9e43f2 100644 --- a/PySimpleGUI.py +++ b/PySimpleGUI.py @@ -1646,11 +1646,14 @@ class FlexForm: self.TKroot.y = None def OnMotion(self, event): - deltax = event.x - self.TKroot.x - deltay = event.y - self.TKroot.y - x = self.TKroot.winfo_x() + deltax - y = self.TKroot.winfo_y() + deltay - self.TKroot.geometry("+%s+%s" % (x, y)) + try: + deltax = event.x - self.TKroot.x + deltay = event.y - self.TKroot.y + x = self.TKroot.winfo_x() + deltax + y = self.TKroot.winfo_y() + deltay + self.TKroot.geometry("+%s+%s" % (x, y)) + except: + pass def _KeyboardCallback(self, event ):