MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / title_bar

Function title_bar

DemoPrograms/Demo_Titlebar_Custom_Async.py:62–76  ·  view source on GitHub ↗

Creates a "row" that can be added to a layout. This row looks like a titlebar :param title: The "title" to show in the titlebar :type title: str :return: A list of elements (i.e. a "row" for a layout) :type: List[sg.Element]

(title, text_color, background_color)

Source from the content-addressed store, hash-verified

60
61
62def title_bar(title, text_color, background_color):
63 """
64 Creates a "row" that can be added to a layout. This row looks like a titlebar
65 :param title: The "title" to show in the titlebar
66 :type title: str
67 :return: A list of elements (i.e. a "row" for a layout)
68 :type: List[sg.Element]
69 """
70 bc = background_color
71 tc = text_color
72
73 return [sg.Col([[sg.T(title, text_color=tc, background_color=bc)]], pad=(0, 0), background_color=bc),
74 sg.Col([[sg.T('_', text_color=tc, background_color=bc, enable_events=True, key='-MINIMIZE-'),
75 sg.Text('❎', text_color=tc, background_color=bc, enable_events=True, key='Exit')]], element_justification='r', key='-TITLEBAR-',
76 pad=(0, 0), background_color=bc)]
77
78
79def main():

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected