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)
| 51 | |
| 52 | |
| 53 | def 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 |