Changeset 65:766236a9c924
- Timestamp:
- 12/11/10 14:35:01 (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Interface.py
r64 r65 š 274 274 if self.keys[key] == index:š 275 275 del self.keys[key]š 276 š self.selected_state = indexš š 276 del automata.states[index]š š 277 if index in automata.states:š š 278 self.selected_state = indexš š 279 elif len(automata.states):š š 280 self.selected_state = len(automata.states) - 1š š 281 else:š š 282 self.selected_state = Noneš 277 283 self.refresh_list()š š 284 self.select_item(self.selected_state)š 278 285 š 279 286 def add(self):# add new stateš ? ? š 284 291 nums = []š 285 292 for i, value in enumerate(ckeckbox_nums):š 286 š if value:š287 š nums.append(i)šš 293 if value.get() == 1:š š 294 nums.append(i)š 288 295 if self.keys.has_key(key):š 289 296 error.config(text="State with such key has already existed")š ? ? š 304 311 self.keys[key] = len(automata.states) - 1š 305 312 error.config(text="")š š 313 self.selected_state = len(automata.states) - 1š 306 314 self.refresh_list()š š 315 self.select_item(self.selected_state)š 307 316 š 308 317 def change(self):# change chosen stateš ? ? š 351 360 def hide_automata_window(self):š 352 361 automata_window.withdraw()š š 362 š 353 363 def refresh_list(self):š 354 364 state_list.delete(0, "end")š ? ? š 357 367 if self.selected_state != None:š 358 368 state_list.selection_set(self.selected_state)š 359 š def list_mouse_release(self, event):š 360 š selected = state_list.curselection()š 361 š self.selected_state = int(selected[0])š 362 š if len(selected):š 363 š index = int(selected[0])š š 369 š š 370 def select_item(self, index):š š 371 if index != None:š 364 372 state = automata.states[index]š 365 373 state_name.delete(0, "end")š ? ? š 374 382 for i in range(9):š 375 383 ckeckbox_nums[i].set(i in state.nums)š 376 š š š 384 else:š š 385 state_name.delete(0, "end")š š 386 state_symbol.delete(0, "end")š š 387 state_key.delete(0, "end")š š 388 state_color.config(bg="white")š š 389 for i in range(9):š š 390 ckeckbox_nums[i].set(False)š š 391 š š 392 def list_mouse_release(self, event):š š 393 selected = state_list.curselection()š š 394 self.selected_state = int(selected[0])š š 395 if len(selected):š š 396 self.select_item(self.selected_state)š 377 397 def choose_color(self, event):š 378 398 state_color.config(bg=tkColorChooser.askcolor()[1])š 379 š š380 399 š 381 400 š
Note: See TracChangeset
for help on using the changeset viewer.