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)
| 16 | |
| 17 | |
| 18 | def 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 |