GLXCurses.ToolBar module

class GLXCurses.ToolBar.ToolBar[source]

Bases: GLXCurses.Widget.Widget

draw()[source]

Draw the ToolBar widget

labels

Get the labels list, it contain items with dictionary with key ‘id’, ‘text’, ‘end_coord’

Returns:The labels list
Return type:list
init_button_positions()[source]

Calculate positions of buttons; width is never less than 7

Else distribute the extra width in a way that the middle vertical line (between F5 and F6) aligns with the center of the screen.

The extra width is distributed in this order: F10, F5, F9, F4, …, F6, F1.

get_button_width(i=None)[source]

return width of one button

Parameters:i (int) – button number it start to 0
Returns:width of one button
Return type:int
Raises:TypeError – When i is not a int type
get_button_by_x_coord(x=None)[source]

Return the button number by it X coordinate

Parameters:x (int) – X coordinate value
Returns:the button number
Return type:int
Raises:TypeError – When x is not a int type
set_label_text(idx=None, text=None)[source]

Set the text to a button

Parameters:
  • idx (int) – The button id it start by 0
  • text (str) – The text to set to it button
update_preferred_sizes()[source]