ViewInSameCellProperty

class ipkiss3.all.ViewInSameCellProperty

A property containing a View within the same cell.

the property will try to resolve the view in the same cell of the correct base type.

When asigning a View, a PCell or an Instance, it will convert it to the corresponding view of the correct type, if necessary using the default view when it cannot be identified directly. You can also assign a string, and then it will first try to look up the view by its name, and then by the name of its View class.

Parameters:
view_type: A View object, of which the base view type will be extracted
doc: string

Documentation string

restriction: an Property Restriction object (default = None)

An additional restriction on top of the restriction that it should be a view on the same cell.

Examples

import ipkiss3.all as i3

class MyPCell(i3.PCell):
    class Layout(i3.LayoutView):
        length = i3.PositiveNumberProperty(default=10)

    class CircuitModel(i3.CircuitModelView):
        layout_view = i3.ViewInSameCellProperty(view_type=i3.LayoutView)

        def print_info(self):
            length = self.layout_view.length
            print("Inside the CircuitModel view, the length extracted from layout equals {}".format(length))

my_cell = MyPCell()
layout = my_cell.Layout(length=15)
circuitmodel = my_cell.CircuitModel()

circuitmodel.print_info()
allow_none
default
doc
preprocess
restriction
fdef_name
view_type