2.1.3.4.1. pyfx.view.json_lib.json_listbox.JSONListBox¶
- class JSONListBox(walker)¶
A ListBox with special handling for navigation and collapsing of JSONWidgets.
Methods
__init__(walker)calculate_visible(size[, focus])Returns the widgets that would be displayed in the ListBox given the current size and focus.
change_focus(size, position[, offset_inset, ...])Change the current focus widget.
collapse_all(size)Collapses all JSON nodes
ends_visible(size[, focus])Return a list that may contain
'top'and/or'bottom'.expand_all(size)Expands all the JSON nodes
get_cursor_coords(size)See
Widget.get_cursor_coords()for detailsget_focus()Return a (focus widget, focus position) tuple, for backwards compatibility.
get_focus_offset_inset(size)Return (offset rows, inset rows) for focus widget.
get_focus_path()Return the .focus_position values starting from this container and proceeding along each child widget until reaching a leaf (non-container) widget.
get_focus_widgets()Return the .focus values starting from this container and proceeding along each child widget until reaching a leaf (non-container) widget.
keypress(size, key)Move selection through the list elements scrolling when necessary.
make_cursor_visible(size)Shift the focus widget so that its cursor is visible.
mouse_event(size, event, button, col, row, focus)Handles mouse click to expand/collapse compose node.
Moves focus from an end node to start node
move_focus_to_next_line(size)Moves focus to next line
move_focus_to_prev_line(size)Moves focus to previous line
options()There are currently no options for ListBox contents.
pack(size[, focus])See
Widget.render()for parameter details.render(size[, focus])Render ListBox and return canvas.
selectable()- returns:
Trueif this is a widget that is designed to take the
set_focus(position[, coming_from])Set the focus position and try to keep the old focus in view.
set_focus_path(positions)Set the .focus_position property starting from this container widget and proceeding along newly focused child widgets.
set_focus_valign(valign)Set the focus widget's display offset and inset.
shift_focus(size, offset_inset)Move the location of the current focus relative to the top.
sizing()- returns:
A frozenset including one or more of
'box','flow'and
Toggles collapse on JSON object or array node
update_pref_col_from_focus(size)Update self.pref_col from the focus widget.
Attributes
base_widgetRead-only property that steps through decoration widgets and returns the one at the base.
bodya ListWalker subclass such as
SimpleFocusListWalkerthat contains widgets to be displayed inside the list boxcontentsAn object that allows reading widgets from the ListBox's list walker as a (widget, options) tuple.
focusthe child widget in focus or None when ListBox is empty.
focus_positionthe position of child widget in focus.
- collapse_all(size)¶
Collapses all JSON nodes
- expand_all(size)¶
Expands all the JSON nodes
- keypress(size, key)¶
Move selection through the list elements scrolling when necessary. Keystrokes are first passed to widget in focus in case that widget can handle them.
- Keystrokes handled by this widget are:
‘up’ up one line (or widget) ‘down’ down one line (or widget) ‘page up’ move cursor up one listbox length (or widget) ‘page down’ move cursor down one listbox length (or widget)
- mouse_event(size, event, button, col, row, focus)¶
Handles mouse click to expand/collapse compose node.
- move_focus_from_end_node_to_start_node(size)¶
Moves focus from an end node to start node
- move_focus_to_next_line(size)¶
Moves focus to next line
- move_focus_to_prev_line(size)¶
Moves focus to previous line
- toggle_collapse_on_focused_parent(size)¶
Toggles collapse on JSON object or array node