Changed use of keyword "k" to key for better portability to older versions of PySimpleGUI. More example titlebar color setups
This commit is contained in:
parent
1b1ca99275
commit
3261b96d46
|
@ -24,7 +24,7 @@ import PySimpleGUI as sg
|
|||
# 'PROGRESS': ('#505F69', '#32414B'),
|
||||
# 'BORDER': 1, 'SLIDER_DEPTH': 0, 'PROGRESS_DEPTH': 0,
|
||||
# }
|
||||
#
|
||||
|
||||
# sg.theme_add_new('DarkGrey8', DarkGrey8)
|
||||
|
||||
|
||||
|
@ -56,7 +56,7 @@ def title_bar(title, text_color, background_color):
|
|||
tc = text_color
|
||||
|
||||
return [sg.Col([[sg.T(title,text_color=tc, background_color=bc )]], pad=(0, 0), background_color=bc),
|
||||
sg.Col([[sg.T('_', text_color=tc, background_color=bc, enable_events=True, key='-MINIMIZE-'),sg.Text('❎', text_color=tc, background_color=bc, enable_events=True, key='Exit')]], element_justification='r', k='-C-', pad=(0, 0), background_color=bc)]
|
||||
sg.Col([[sg.T('_', text_color=tc, background_color=bc, enable_events=True, key='-MINIMIZE-'),sg.Text('❎', text_color=tc, background_color=bc, enable_events=True, key='Exit')]], element_justification='r', key='-C-', pad=(0, 0), background_color=bc)]
|
||||
|
||||
|
||||
|
||||
|
@ -67,8 +67,10 @@ def main():
|
|||
sg.theme('DarkGrey8')
|
||||
|
||||
title = 'Customized Titlebar Window'
|
||||
|
||||
layout = [ title_bar(title, sg.theme_button_color()[0], sg.theme_button_color()[1]),
|
||||
# Here the titlebar colors are based on the theme. A few suggestions are shown. Try each of them
|
||||
layout = [ title_bar(title, sg.theme_button_color()[0], sg.theme_button_color()[1]),
|
||||
# title_bar(title, sg.theme_button_color()[1], sg.theme_slider_color()),
|
||||
# title_bar(title, sg.theme_slider_color(), sg.theme_button_color()[0]),
|
||||
[sg.T('This is normal window text. The above is the fake "titlebar"')],
|
||||
[sg.T('Input something:')],
|
||||
[sg.Input(key='-IN-'), sg.Text(size=(12,1), key='-OUT-')],
|
||||
|
|
Loading…
Reference in New Issue