MCPcopy Index your code
hub / github.com/PySimpleGUI/PySimpleGUI / add_row

Method add_row

PySimpleGUI/PySimpleGUI.py:7347–7394  ·  view source on GitHub ↗

Not recommended use call. Used to add rows of Elements to the Frame Element. :param *args: The list of elements for this row :type *args: List[Element]

(self, *args)

Source from the content-addressed store, hash-verified

7345 return
7346
7347 def add_row(self, *args):
7348 """
7349 Not recommended use call. Used to add rows of Elements to the Frame Element.
7350
7351 :param *args: The list of elements for this row
7352 :type *args: List[Element]
7353 """
7354 NumRows = len(self.Rows) # number of existing rows is our row number
7355 CurrentRowNumber = NumRows # this row's number
7356 CurrentRow = [] # start with a blank row and build up
7357 # ------------------------- Add the elements to a row ------------------------- #
7358 for i, element in enumerate(args): # Loop through list of elements and add them to the row
7359 if type(element) == list:
7360 popup_error_with_traceback('Error creating Tab layout',
7361 'Layout has a LIST instead of an ELEMENT',
7362 'This sometimes means you have a badly placed ]',
7363 'The offensive list is:',
7364 element,
7365 'This list will be stripped from your layout')
7366 continue
7367 elif callable(element) and not isinstance(element, Element):
7368 popup_error_with_traceback('Error creating Tab layout',
7369 'Layout has a FUNCTION instead of an ELEMENT',
7370 'This likely means you are missing () from your layout',
7371 'The offensive list is:',
7372 element,
7373 'This item will be stripped from your layout')
7374 continue
7375 if element.ParentContainer is not None:
7376 warnings.warn(
7377 '*** YOU ARE ATTEMPTING TO REUSE AN ELEMENT IN YOUR LAYOUT! Once placed in a layout, an element cannot be used in another layout. ***',
7378 UserWarning)
7379 popup_error_with_traceback('Error creating Tab layout',
7380 'The layout specified has already been used',
7381 'You MUST start witha "clean", unused layout every time you create a window',
7382 'The offensive Element = ',
7383 element,
7384 'and has a key = ', element.Key,
7385 'This item will be stripped from your layout',
7386 'Hint - try printing your layout and matching the IDs "print(layout)"')
7387 continue
7388 element.Position = (CurrentRowNumber, i)
7389 element.ParentContainer = self
7390 CurrentRow.append(element)
7391 if element.Key is not None:
7392 self.UseDictionary = True
7393 # ------------------------- Append the row to list of Rows ------------------------- #
7394 self.Rows.append(CurrentRow)
7395
7396 def layout(self, rows):
7397 """

Callers 1

_convert_window_to_tkFunction · 0.45

Calls 1

Tested by

no test coverage detected