SequencesBox.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:sbrick-controller 作者: wintersandroid 项目源码 文件源码
def __init__(self, configuration, sbrick_communications_store):
        Gtk.Box.__init__(self, orientation=Gtk.Orientation.VERTICAL, spacing=3, margin=0)
        self.set_homogeneous(False)
        self.configuration = configuration
        self.sbrick_communications_store = sbrick_communications_store

        self.tool_bar = Gtk.Toolbar()
        self.pack_start(self.tool_bar, False, True, 0)

        self.action_play_all = Gtk.ToolButton.new(Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_PLAY, Gtk.IconSize.BUTTON),
                                                  "Play All")
        self.action_play_all.connect("clicked", self.on_play_all_clicked)
        self.tool_bar.insert(self.action_play_all, -1)
        self.action_stop_all = Gtk.ToolButton.new(Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_STOP, Gtk.IconSize.BUTTON),
                                                  "Stop All")
        self.action_stop_all.connect("clicked", self.on_stop_all_clicked)
        self.tool_bar.insert(self.action_stop_all, -1)
        self.content = Gtk.ListBox()

        self.scrollTree = Gtk.ScrolledWindow()
        self.scrollTree.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
        self.scrollTree.add_with_viewport(self.content)
        self.scrollTree.set_min_content_height(100)
        self.pack_start(self.scrollTree, True, True, 0)

        self.sequence_count = 0
        if self.configuration is not None:
            for sbrick in self.configuration:
                stepbox = SequencePlayerBox(sbrick, sbrick_communications_store)
                stepbox.connect("sequence_finished", self.on_sequence_finished)
                self.content.add(stepbox)
                self.sequence_count = self.sequence_count + 1
        self.playing = False
        self.playing_sequence = None
        self.playing_index = -1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号