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

Function title_bar

DemoPrograms/Demo_Window_Background_Image.py:18–36  ·  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 :param text_color: Text color for titlebar :type text_color: str :param background_color: Background color for titlebar :type

(title, text_color, background_color)

Source from the content-addressed store, hash-verified

16
17
18def title_bar(title, text_color, background_color):
19 """
20 Creates a "row" that can be added to a layout. This row looks like a titlebar
21 :param title: The "title" to show in the titlebar
22 :type title: str
23 :param text_color: Text color for titlebar
24 :type text_color: str
25 :param background_color: Background color for titlebar
26 :type background_color: str
27 :return: A list of elements (i.e. a "row" for a layout)
28 :rtype: List[sg.Element]
29 """
30 bc = background_color
31 tc = text_color
32 font = 'Helvetica 12'
33
34 return [sg.Col([[sg.T(title, text_color=tc, background_color=bc, font=font, grab=True)]], pad=(0, 0), background_color=bc),
35 sg.Col([[sg.T('_', text_color=tc, background_color=bc, enable_events=True, font=font, key='-MINIMIZE-'), sg.Text('❎', text_color=tc, background_color=bc, font=font, enable_events=True, key='Exit')]], element_justification='r', key='-C-', grab=True,
36 pad=(0, 0), background_color=bc)]
37
38
39

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected