本文整理汇总了Python中Geometry.add_state方法的典型用法代码示例。如果您正苦于以下问题:Python Geometry.add_state方法的具体用法?Python Geometry.add_state怎么用?Python Geometry.add_state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geometry
的用法示例。
在下文中一共展示了Geometry.add_state方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_state
# 需要导入模块: import Geometry [as 别名]
# 或者: from Geometry import add_state [as 别名]
def add_state(self):
new_state_name = self.control_window.state_entry.get()
print(new_state_name)
self.control_window.state_entry.delete(0, END)
self.states.append(State(self.control_window.frame, new_state_name))
new_state = self.states[-1]
new_state.state_label.grid(row=len(self.states), column=0)
new_state.transition_button.configure(text="TRANSITION", command=lambda : self.transition(new_state))
new_state.transition_button.grid(row=len(self.states), column=1)
new_state.delete_button.configure(text="DELETE", command=lambda : self.delete_state(new_state))
new_state.delete_button.grid(row=len(self.states), column=2)
new_state.accept_button.configure(text="ACCEPT", command=lambda : self.make_accepting(new_state))
new_state.accept_button.grid(row=len(self.states), column=3)
new_state.entry_button.configure(text="--->", command=lambda : self.make_entry(new_state))
new_state.entry_button.grid(row=len(self.states), column=4)
self.parser.add_state(new_state)
Geometry.add_state(self.canvas_window, new_state, self.states)
pass