diff --git a/DemoPrograms/Demo_Columns.py b/DemoPrograms/Demo_Columns.py index f55c0f37..77e45586 100644 --- a/DemoPrograms/Demo_Columns.py +++ b/DemoPrograms/Demo_Columns.py @@ -7,11 +7,10 @@ import PySimpleGUI as sg sg.theme('BlueMono') -css = {'text_color': 'white', 'background_color': 'blue'} # Column layout -col = [[sg.Text('col Row 1', **css)], - [sg.Text('col Row 2', **css), sg.Input('col input 1')], - [sg.Text('col Row 3', **css), sg.Input('col input 2')]] +col = [[sg.Text('col Row 1', text_color='white', background_color='blue')], + [sg.Text('col Row 2', text_color='white', background_color='blue'), sg.Input('col input 1')], + [sg.Text('col Row 3', text_color='white', background_color='blue'), sg.Input('col input 2')]] # Window layout layout = [[sg.Listbox(values=('Listbox Item 1', 'Listbox Item 2', 'Listbox Item 3'), select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE, size=(20, 3)), diff --git a/DemoPrograms/Demo_Floating_Toolbar.py b/DemoPrograms/Demo_Floating_Toolbar.py index 162685ef..b87caeda 100644 --- a/DemoPrograms/Demo_Floating_Toolbar.py +++ b/DemoPrograms/Demo_Floating_Toolbar.py @@ -14,15 +14,14 @@ close64 = 'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEQ0lEQVR42r2XW2wbRRSG/ def main(): - btn_css = { - 'button_color': ('white', 'black'), - 'pad': (0, 0), - } - toolbar_buttons = [[sg.Button(image_data=close64, **btn_css, key='-CLOSE-'), - sg.Button(image_data=timer64, **btn_css, key='-TIMER-'), - sg.Button(image_data=house64, **btn_css, key='-HOUSE-'), - sg.Button(image_data=cpu64, **btn_css, key='-CPU-'), ]] + def tbutton(image_data, key): + return sg.Button(image_data=image_data, button_color=('white', 'black'), pad=(0,0), key=key) + + toolbar_buttons = [[tbutton(close64, '-CLOSE-'), + tbutton(timer64, '-TIMER-'), + tbutton(house64, '-HOUSE-'), + tbutton(cpu64, '-CPU-') ]] # layout = toolbar_buttons layout = [[sg.Col(toolbar_buttons, background_color='black')]]