コード例 #1
0
    def _change_toolbar_speechbubble_text(self, widget, scene, name):
        scene.remove_widget("toolbar_speechbubble")

        if name in self._toolbar_icons:
            widget.set_image(self._toolbar_icons[name]["icon"])
            text = self._toolbar_icons[name]["text"]
            position = self._toolbar_icons[name]["position"]
            source_align = self._toolbar_icons[name]["source_align"]

            self._toolbar_icons[name]['opened'] = True
            fixed = Gtk.Fixed()
            fixed.set_size_request(500, 300)

            sb = SpeechBubble(text=text,
                              source=SpeechBubble.BOTTOM,
                              source_align=source_align)
            sb.connect('button-release-event', self._close_speechbubble, scene)

            fixed.put(sb, position[0], position[1])
            scene.add_widget(fixed,
                             Placement(1.0, 1.0),
                             Placement(1.0, 1.0),
                             name="toolbar_speechbubble")

            # If the icon is in the toolbar, show the next button
            if not self._toolbar_next_button_shown:
                self._toolbar_next_button_shown = True
                scene.add_widget(NextButton(), Placement(0.5, 0.5, 0),
                                 Placement(0.5, 0.5, 0), self.fourth_scene)
コード例 #2
0
    def _change_apps_speechbubble_text(self, widget, name, scene):
        scene.remove_widget("app_speechbubble")
        widget.set_image(self._desktop_icons[name]['icon'])

        if name in self._desktop_icons:
            text = self._desktop_icons[name]["text"]
            self._desktop_icons[name]['opened'] = True

            sb = SpeechBubble(
                text=text,
                source=SpeechBubble.BOTTOM,
                source_align=self._desktop_icons[name]["source_align"])
            sb.connect('button-release-event', self._close_speechbubble, scene)

            fixed = Gtk.Fixed()
            fixed.set_size_request(1024, 720)
            fixed.put(sb, self._desktop_icons[name]["position"][0],
                      self._desktop_icons[name]["position"][1])

            scene.add_widget(
                fixed,
                Placement(0.5, 1, 0),
                Placement(0.5, 1, 0),
                name="app_speechbubble",
            )

        for icon in self._desktop_icons.itervalues():
            if not icon.has_key('opened') or not icon['opened']:
                return True

        if not self._apps_next_button_shown:
            self._apps_next_button_shown = True
            scene.add_widget(NextButton(), Placement(0.5, 0.3, 0),
                             Placement(0.5, 0.4, 0), self.next_stage)