当前位置: 首页>>代码示例>>Python>>正文


Python Clutter.init方法代码示例

本文整理汇总了Python中gi.repository.Clutter.init方法的典型用法代码示例。如果您正苦于以下问题:Python Clutter.init方法的具体用法?Python Clutter.init怎么用?Python Clutter.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gi.repository.Clutter的用法示例。


在下文中一共展示了Clutter.init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
def main():
    GLib.threads_init()
    Clutter.init(sys.argv)

    MainWindow()

    Clutter.main()
开发者ID:RainCT,项目名称:tortellini,代码行数:9,代码来源:main.py

示例2: __init__

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
    def __init__(self, argv, descriptor):
        super().__init__()
        Clutter.init(sys.argv)

        # application main window, instance of :see: :class: `window.Window`:
        self.window = None

        # path to a file with style definition:
        self.style = None

        # dictionary for all the application basic elements:
        self.box = {}

        # if playing of the sound effects should be enabled:
        self.sound_effects_enabled = False

        # indicator of the application main loop status, should be used
        # with caution as there will always be some non-zero time interval
        # between setting this flag 'True' and actual launching of the loop and
        # between actual quit of the loop and setting the flag 'False':
        self.main_loop_is_running = False

        # player of any audio effects:
        self.sound_effects_player = None

        self._sound_effects = {}

        self._read_descriptor(descriptor)
        self._configure()
        self._initialize_style()
        self._initialize_window(argv, descriptor)
        self._initialize_sound_effects_player()
开发者ID:BrainTech,项目名称:pisak,代码行数:34,代码来源:application.py

示例3: __init__

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
    def __init__(self):
        Clutter.init([])
        self.__latitude = None
        self.__longitude = None
        self.__selected_marker = None
        self.__active_sensitive = False
        self.__marker_last_location = None

        self.__factory = Champlain.MapSourceFactory.dup_default()
        self.__set_location_context_menu = None
        self.__locations = []
        self.__task_locations = {}
        self.__tag_locations = {}
        self.__view = None
        self.__vbox_map = None
        self.__map = None
        self.__current_layer = None
        self.__menu_item_tag_sidebar = None
        self.__plugin_api = None

        self.__where = Geoclue()
        self.__where.client.connect_to_signal(
            'LocationUpdated', self._location_updated
        )
        self.__where.client.Start()
        self.__distance = 15

        self.__preferences = None
开发者ID:elianerpereira,项目名称:gtg-1,代码行数:30,代码来源:geolocalized_tasks.py

示例4: __init__

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
 def __init__(self, container, argv):
     PisakEduApp.APP = self
     Clutter.init(argv)
     self.stage = PisakEduStage(container)
     self.stage.connect("destroy", lambda _: Clutter.main_quit())
     self.stage.set_fullscreen(True)
     self.stage.show_all()
开发者ID:karolaug,项目名称:pisak,代码行数:9,代码来源:panels.py

示例5: start

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
 def start(self):
     """Starts the Clutter main event loop and sets our kernel startup routine.
     """
     # Register our function to initiate the kernel and start Clutter
     GObject.idle_add(self._wire_kernel)
     Clutter.init([])
     Clutter.main()
开发者ID:vindolin,项目名称:ipython,代码行数:9,代码来源:clutterembed.py

示例6: __init__

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
    def __init__(self):
        Clutter.init()

        self.stage = TextStage()
        self.stage.connect("destroy", lambda *_: Clutter.main_quit())
        self.stage.show_all()

        Clutter.main()
开发者ID:karolaug,项目名称:pisak,代码行数:10,代码来源:pisak_text.py

示例7: __init__

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
 def __init__(self, argv):
     PisakSpellerApp.APP = self
     Clutter.init(argv)
     self.stage = PisakSpellerStage()
     TimerCycle(self.stage.contents).start_cycle()
     self.stage.connect("destroy", lambda _: Clutter.main_quit())
     self.stage.set_fullscreen(True)
     self.stage.show_all()
开发者ID:karolaug,项目名称:pisak,代码行数:10,代码来源:speller.py

示例8: run

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
 def run(self):
     # Import clutter only in the gobject thread
     # This function will be the running mainloop
     try:
         from gi.repository import Clutter as clutter
         clutter.threads_init()
         clutter.init([])
         clutter.main()
     except Exception, e:
         log.exception('unable to import clutter')
         return
开发者ID:freevo,项目名称:kaa-candy,代码行数:13,代码来源:main.py

示例9: create_ui

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
    def create_ui(self):
        Clutter.init()
        Clutter.threads_init()

        self.clutter = GtkClutter.Embed()
        self.clutter.set_size_request(420, 280)

        self.stage = self.clutter.get_stage()
        self.stage.set_background_color(Clutter.Color
                                        .from_string('#8c8c8c')[1])
        self.stage.show_all()

        self.widget.add(self.clutter)
开发者ID:cfobel,项目名称:clutter-webcam-viewer,代码行数:15,代码来源:__init__.py

示例10: __init__

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
 def __init__(self, argv):
     """
     Initialize the application. Call methods that initialize
     application stage, style and global sound effects player. 
     
     :param: argv application arguments
     """
     super().__init__()
     Gtk.init(sys.argv)
     Clutter.init(sys.argv)
     self._configure()
     self._initialize_style()
     self._initialize_window(argv)
     self._initialize_sound_effects_player()
开发者ID:bjura,项目名称:SwitchDJ,代码行数:16,代码来源:application.py

示例11: __init__

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
  def __init__ (self):
    # initialize Clutter
    Clutter.init([])
    
    self.colors = {
      'white' : Clutter.Color.new(0, 0, 0, 255),
      'blue' : Clutter.Color.new(16, 16, 32, 255),
      'black' : Clutter.Color.new(255, 255, 255, 128),
      'hand' : Clutter.Color.new(16, 32, 16, 196)
    }

    # create a resizable stage
    stage = Clutter.Stage.new ()
    stage.set_title ("2D Clock")
    stage.set_user_resizable (True)
    stage.set_background_color (self.colors['blue'])
    stage.set_size (300, 300)
    stage.show ()

    # our 2D canvas, courtesy of Cairo
    canvas = Clutter.Canvas.new ()
    canvas.set_size (300, 300)

    actor = Clutter.Actor.new ()
    actor.set_content (canvas)
    
    actor.set_content_scaling_filters (Clutter.ScalingFilter.TRILINEAR,
                                       Clutter.ScalingFilter.LINEAR)
    stage.add_child (actor)

    # bind the size of the actor to that of the stage
    actor.add_constraint(Clutter.BindConstraint.new(stage, Clutter.BindCoordinate.SIZE, 0))

    # resize the canvas whenever the actor changes size
    actor.connect ("allocation-changed", self.on_actor_resize)

    # quit on destroy
    stage.connect ("destroy", self.on_destroy)

    # connect our drawing code
    canvas.connect ("draw", self.draw_clock)

    # invalidate the canvas, so that we can draw before the main loop starts
    Clutter.Content.invalidate (canvas)

    # set up a timer that invalidates the canvas every second
    Clutter.threads_add_timeout (GLib.PRIORITY_DEFAULT, 1000, self.invalidate_clock, canvas)

    Clutter.main ()
开发者ID:lubosz,项目名称:gst-gl-tests,代码行数:51,代码来源:clutter-canvas.py

示例12: main

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
def main():
    if len(sys.argv) < 2:
        print "Usage: %s [OPTIONS] <video file> [logo file]" % (sys.argv[0])
    else:
        if DEBUG:
            Clutter.init(debugArgs)
        else:
            Clutter.init(sys.argv)

        filename = sys.argv[1]
        if len(sys.argv) > 2:
            logo = sys.argv[2]
        else:
            logo = None
        app = VideoApp(filename, logo)
        Clutter.main()
开发者ID:skinkie,项目名称:clutter-gst,代码行数:18,代码来源:video-player.py

示例13: main

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
def main():
	Clutter.init(sys.argv)

	# Tests
	guy = PPGuy.PPGuy()
	guy.set_property("direction", 100)
	guy.connect("collide", collide_cb)
	print guy.get_property("direction")

	maze = PPMaze.PPMaze()
	print maze.get_property("width")
	print maze.get_property("height")

	guy.emit("collide", PPGuy.PPGuy())

	game = PPGame.PPGame()
	Mx.Application.run(game)
开发者ID:diegotoral,项目名称:pill-popper,代码行数:19,代码来源:pill-popper.py

示例14: enable

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
        def enable(self, app=None):
            """Enable event loop integration with Clutter.

            Parameters
            ----------
            app : ignored
               Ignored, it's only a placeholder to keep the call signature of all
               gui activation methods consistent, which simplifies the logic of
               supporting magics.

            Notes
            -----
            This methods sets the PyOS_InputHook for Clutter, which allows
            the Clutter to integrate with terminal based applications like
            IPython.
            """
            if GUI_CLUTTER not in self.manager.apps:
                Clutter.init([])

            self.manager.set_inputhook(inputhook_clutter)
            self.manager._current_gui = GUI_CLUTTER
            self.manager.apps[GUI_CLUTTER] = True
开发者ID:vindolin,项目名称:IPython-Clutter-GUI-Integration,代码行数:24,代码来源:cluttergui.py

示例15: ObjectTest

# 需要导入模块: from gi.repository import Clutter [as 别名]
# 或者: from gi.repository.Clutter import init [as 别名]
import sys
import unittest

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GObject, Gdk, Gio

from tests import skipIfGI

try:
    from gi.repository import Clutter
    Clutter
except ImportError:
    Clutter = None
else:
    status, argv = Clutter.init(sys.argv)
    if status == Clutter.InitError.SUCCESS:
        sys.argv = argv
    else:
        Clutter = None


class ObjectTest(unittest.TestCase):

    def test_classes(self):
        g = GObject.Object()
        self.assertTrue(isinstance(g, GObject.Object))
        a = Gtk.AccelMap()
        self.assertTrue(isinstance(a, type(g)))

    def test_init_1(self):
开发者ID:SunilMohanAdapa,项目名称:pgi,代码行数:33,代码来源:test_objects.py


注:本文中的gi.repository.Clutter.init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。