comparison pyink/MBScene.py @ 963:a05ec4fb1c20

update framelines according content 0f layers
author Thinker K.F. Li <thinker@codemud.net>
date Wed, 17 Nov 2010 17:24:59 +0800
parents 6612fd386ea9
children 1028f6278ead
comparison
equal deleted inserted replaced
962:6612fd386ea9 963:a05ec4fb1c20
503 btn.add(img) 503 btn.add(img)
504 btn.connect("button_press_event", self.cellSelect) 504 btn.connect("button_press_event", self.cellSelect)
505 btn.modify_bg(gtk.STATE_NORMAL, btn.get_colormap().alloc_color("gray")) 505 btn.modify_bg(gtk.STATE_NORMAL, btn.get_colormap().alloc_color("gray"))
506 return btn 506 return btn
507 507
508 def create_framelines(self): 508 def _create_framelines(self):
509 import frameline 509 import frameline
510 self.scrollwin = gtk.ScrolledWindow() 510 self.scrollwin = gtk.ScrolledWindow()
511 self.scrollwin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) 511 self.scrollwin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
512 self.scrollwin.set_size_request(-1,150) 512 self.scrollwin.set_size_request(-1,150)
513 513
532 vbox.pack_start(line, False) 532 vbox.pack_start(line, False)
533 self._framelines.append(line) 533 self._framelines.append(line)
534 pass 534 pass
535 pass 535 pass
536 536
537 def update_all_framelines(self): 537 ## \brief Update conetent of frameliens according layers.
538 for layer in self.layers: 538 #
539 def _update_framelines(self):
540 for layer_i, layer in enumerate(self.layers):
539 for scene in layer.scenes: 541 for scene in layer.scenes:
542 frameline = self._framelines[layer_i]
543 for scene_i in range(scene.start, scene.stop + 1):
544 frameline.add_keyframe(scene_i)
545 pass
540 pass 546 pass
541 pass 547 pass
542 pass 548 pass
543 549
544 def showGrid(self): 550 def showGrid(self):
678 pass 684 pass
679 685
680 def show(self): 686 def show(self):
681 self.OK = True 687 self.OK = True
682 self.parseScene() 688 self.parseScene()
683 # self.showGrid() 689 self._create_framelines()
684 self.create_framelines() 690 self._update_framelines()
685 vbox = gtk.VBox(False,0) 691 vbox = gtk.VBox(False,0)
686 self.desktop.getToplevel().child.child.pack_end(vbox,expand=False) 692 self.desktop.getToplevel().child.child.pack_end(vbox,expand=False)
687 self.window = vbox 693 self.window = vbox
688 # self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) 694 # self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
689 # self.window.connect("destroy", gtk.main_quit) 695 # self.window.connect("destroy", gtk.main_quit)