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)
| 60 | |
| 61 | |
| 62 | def 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 | |
| 79 | def main(): |