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

Function title_bar

DemoPrograms/Demo_Titlebar_Custom_Dark_Theme.py:53–70  ·  view source on GitHub ↗

Creates a Column element meant to be used as a single row. This row looks like a titlebar. :param title: The "title" to show in the titlebar :type title: str :return: A single Column element that can be used as a single row in your layout :type: sg.Column

(title, text_color, background_color)

Source from the content-addressed store, hash-verified

51
52
53def title_bar(title, text_color, background_color):
54 """
55 Creates a Column element meant to be used as a single row. This row looks like a titlebar.
56 :param title: The "title" to show in the titlebar
57 :type title: str
58 :return: A single Column element that can be used as a single row in your layout
59 :type: sg.Column
60 """
61 bc = background_color
62 tc = text_color
63
64 return sg.Col([[sg.Col(
65 [[sg.T(title,text_color=tc, background_color=bc, grab=True, expand_x=True)]],
66 pad=(0, 0), background_color=bc, expand_x=True),
67 sg.Col(
68 [[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')]],
69 element_justification='r', key='-C-', pad=(0, 0), expand_x=True, background_color=bc, grab=True)]],
70 pad=(0,0), grab=True, expand_x=True)
71
72
73

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected