Ejemplo n.º 1
0
def main() -> int:
    main_window = MainWindow(title="table")

    root = Root(width=-1, height=-1)
    main_window.add(root)

    file_names=["al_parco.json", "brachiosauri.json", "monopattino.json", "mostro.json"]
    schemes = [parse_file_name("../data/" + name) for name in file_names]

    table_entries = [
        TableEntry(scheme.title, scheme.hard, len(scheme.rows), len(scheme.cols))
        for scheme in schemes
    ]

    table = ChooserTable(table_entries)

    table.translate(50, 50)

    table.skip = 1
    table.how_many = 10

    table.set_back_callback(lambda: root.set_min_size(200, 200))
    table.set_contents_callback(lambda x: print("{} selected".format(x)))
    table.font_size = 20
    root.set_child(table)

    main_window.override_background_color(Gtk.StateFlags.NORMAL, Gdk.RGBA(.9,.9,.9,1))

    main_window.start_main()
Ejemplo n.º 2
0
def get_models(options: Options = None) -> List[CrucipixelCompleteModel]:
    if options is None or options.schemes_path is None:
        path = _get_default_schemes_path()
    else:
        path = options.schemes_path

    assure_path(path)
    file_names = [name for name in glob.iglob(path + os.sep + "*.json")]

    return [json_parser.parse_file_name(name) for name in file_names]
Ejemplo n.º 3
0
def get_models(options: Options = None) -> List[CrucipixelCompleteModel]:
    if options is None or options.schemes_path is None:
        path = _get_default_schemes_path()
    else:
        path = options.schemes_path

    assure_path(path)
    file_names = [name for name in glob.iglob(path + os.sep + "*.json")]

    return [json_parser.parse_file_name(name) for name in file_names]
Ejemplo n.º 4
0
def main() -> int:
    root = Root()
    main_window = MainWindow(title="Prova")
    main_window.add(root)

    crucipixel_model = parse_file_name("/home/giovanni/.app/monopattino.json")
    crucipixel_core = core.Crucipixel(crucipixel_model)
    crucipixel_core.make_move((MoveAtom(i, i, CrucipixelCellValue.SELECTED) for i in range(5)))
    grid = CrucipixelGrid(crucipixel_core)

    root.set_child(grid)

    main_window.start_main()
Ejemplo n.º 5
0
def main() -> int:
    root = Root()
    main_window = MainWindow(title="Prova")
    main_window.add(root)

    crucipixel_model = parse_file_name("/home/giovanni/.app/monopattino.json")
    crucipixel_core = core.Crucipixel(crucipixel_model)
    crucipixel_core.make_move(
        (MoveAtom(i, i, CrucipixelCellValue.SELECTED) for i in range(5)))
    grid = CrucipixelGrid(crucipixel_core)

    root.set_child(grid)

    main_window.start_main()
Ejemplo n.º 6
0
def main() -> int:
    crucipixel_model = parse_file_name("../data/monopattino.json")
    crucipixel_core = core.Crucipixel(crucipixel_model)
    # cruci_core = core.Crucipixel(
    #     len(cruci_scheme.rows),
    #     len(cruci_scheme.cols),
    #     cruci_scheme.rows,
    #     cruci_scheme.cols
    # )
    complete = PuzzleScreen()
    complete.start_crucipixel(crucipixel_core)
    complete.start_selector()
    complete.start_navigator()

    main_area = MainWindow(title="Complete")
    root = Root()
    root.set_child(complete)
    main_area.add(root)
    main_area.start_main()
Ejemplo n.º 7
0
 def load(self):
     self.__init__(parse_file_name(self._model.file_name_complete))
Ejemplo n.º 8
0
 def load(self):
     self.__init__(parse_file_name(self._model.file_name_complete))