當前位置: 首頁>>代碼示例>>Python>>正文


Python GObject.connect方法代碼示例

本文整理匯總了Python中gobject.GObject.connect方法的典型用法代碼示例。如果您正苦於以下問題:Python GObject.connect方法的具體用法?Python GObject.connect怎麽用?Python GObject.connect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gobject.GObject的用法示例。


在下文中一共展示了GObject.connect方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: on_resource_load_finished

# 需要導入模塊: from gobject import GObject [as 別名]
# 或者: from gobject.GObject import connect [as 別名]
 def on_resource_load_finished(self, func, *args ):
     from gobject import GObject
     def WebView_C_Callable( _webview, _webframe, _webresource, data):
         from .webkit3__WebKitWebFrame import WebKitWebFrame
         from .webkit3__WebKitWebResource import WebKitWebResource
         func( self, self.get_main_frame(), WebKitWebResource(None, obj=_webresource), *args)#WebKitWebFrame(None,obj=_webframe), WebKitWebResource(None,obj=_webresource), *args)
         return None
     CFUNC = CFUNCTYPE(None, POINTER(c_int), POINTER(c_int), POINTER(c_int), POINTER(c_int))
     GObject.connect( self, 'resource-load-finished', func, *args, cfunc = (CFUNC(WebView_C_Callable),CFUNC))
開發者ID:jaykhopale,項目名稱:pywebkit3,代碼行數:11,代碼來源:webkit3__WebKitWebView.py

示例2: _attempt_connection

# 需要導入模塊: from gobject import GObject [as 別名]
# 或者: from gobject.GObject import connect [as 別名]
 def _attempt_connection(self, _backoff):
     self._disconnect_viewer()
     self._session = SpiceClientGtk.Session()
     self._session.set_property('password', self._password)
     self._session.set_property('enable-usbredir', False)
     # Ensure clipboard sharing is disabled
     self._gtk_session = SpiceClientGtk.spice_gtk_session_get(self._session)
     self._gtk_session.set_property('auto-clipboard', False)
     GObject.connect(self._session, 'channel-new', self._new_channel)
     self._session.open_fd(-1)
開發者ID:cmusatyalab,項目名稱:vmnetx,代碼行數:12,代碼來源:view.py

示例3: _connect_viewer

# 需要導入模塊: from gobject import GObject [as 別名]
# 或者: from gobject.GObject import connect [as 別名]
 def _connect_viewer(self, password):
     self._disconnect_viewer()
     self._session = SpiceClientGtk.Session()
     self._session.set_property('password', password)
     self._session.set_property('enable-usbredir', False)
     # Ensure clipboard sharing is disabled
     self._gtk_session = SpiceClientGtk.spice_gtk_session_get(self._session)
     self._gtk_session.set_property('auto-clipboard', False)
     try:
         # Enable audio
         self._audio = SpiceClientGtk.Audio(self._session)
     except RuntimeError:
         # No local PulseAudio, etc.
         pass
     GObject.connect(self._session, 'channel-new', self._new_channel)
     self._session.open_fd(-1)
開發者ID:jaharkes,項目名稱:vmnetx,代碼行數:18,代碼來源:view.py

示例4: _new_channel

# 需要導入模塊: from gobject import GObject [as 別名]
# 或者: from gobject.GObject import connect [as 別名]
 def _new_channel(self, session, channel):
     if session != self._session:
         # Stale channel; ignore
         return
     GObject.connect(channel, 'open-fd', self._request_fd)
     GObject.connect(channel, 'channel-event', self._channel_event)
     type = SpiceClientGtk.spice_channel_type_to_string(
             channel.get_property('channel-type'))
     if type == 'display':
         # Create the display but don't show it until configured by
         # the server
         GObject.connect(channel, 'display-primary-create',
                 self._display_create)
         self._destroy_display()
         self._display_channel = channel
         self._display = SpiceClientGtk.Display(self._session,
                 channel.get_property('channel-id'))
         # Default was False in spice-gtk < 0.14
         self._display.set_property('scaling', True)
         self._display.connect('size-request', self._size_request)
         self._display.connect('keyboard-grab', self._grab, 'keyboard')
         self._display.connect('mouse-grab', self._grab, 'mouse')
         if self._motion_interval is not None:
             self._display.connect('motion-notify-event', self._motion)
     elif type == 'playback':
         if self._audio is None:
             try:
                 # Enable audio
                 self._audio = SpiceClientGtk.Audio(self._session)
             except RuntimeError:
                 # No local PulseAudio, etc.
                 pass
開發者ID:cmusatyalab,項目名稱:vmnetx,代碼行數:34,代碼來源:view.py

示例5: _new_channel

# 需要導入模塊: from gobject import GObject [as 別名]
# 或者: from gobject.GObject import connect [as 別名]
 def _new_channel(self, session, channel):
     if session != self._session:
         # Stale channel; ignore
         return
     GObject.connect(channel, 'open-fd', self._request_fd)
     GObject.connect(channel, 'channel-event', self._channel_event)
     type = SpiceClientGtk.spice_channel_type_to_string(
             channel.get_property('channel-type'))
     if type == 'display':
         # Create the display but don't show it until configured by
         # the server
         GObject.connect(channel, 'display-primary-create',
                 self._display_create)
         self._destroy_display()
         self._display_channel = channel
         self._display = SpiceClientGtk.Display(self._session,
                 channel.get_property('channel-id'))
         # Default was False in spice-gtk < 0.14
         self._display.set_property('scaling', True)
         self._display.connect('size-request', self._size_request)
         self._display.connect('keyboard-grab', self._grab, 'keyboard')
         self._display.connect('mouse-grab', self._grab, 'mouse')
         self._connect_display_signals(self._display)
開發者ID:jaharkes,項目名稱:vmnetx,代碼行數:25,代碼來源:view.py

示例6: on_view_ready

# 需要導入模塊: from gobject import GObject [as 別名]
# 或者: from gobject.GObject import connect [as 別名]
    def on_view_ready(self, func, *args):
        from gobject import GObject
        GObject.connect( self, 'load-finished', func, *args)

        
開發者ID:jaykhopale,項目名稱:pywebkit3,代碼行數:5,代碼來源:webkit3__WebKitWebView.py


注:本文中的gobject.GObject.connect方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。