本文整理匯總了Python中gobject.new方法的典型用法代碼示例。如果您正苦於以下問題:Python gobject.new方法的具體用法?Python gobject.new怎麽用?Python gobject.new使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類gobject
的用法示例。
在下文中一共展示了gobject.new方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _update_ipython_selected_node
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import new [as 別名]
def _update_ipython_selected_node(self):
# If we are running under ipython -gthread, make this new
# selected node available as a global 'selected_node'
# variable.
try:
__IPYTHON__
except NameError:
pass
else:
if self.selected_node is None:
ns3_node = None
else:
self.simulation.lock.acquire()
try:
ns3_node = ns.network.NodeList.GetNode(self.selected_node.node_index)
finally:
self.simulation.lock.release()
__IPYTHON__.user_ns['selected_node'] = ns3_node
示例2: _update_ipython_selected_node
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import new [as 別名]
def _update_ipython_selected_node(self):
# If we are running under ipython -gthread, make this new
# selected node available as a global 'selected_node'
# variable.
try:
__IPYTHON__
except NameError:
pass
else:
if self.selected_node is None:
ns3_node = None
else:
self.simulation.lock.acquire()
try:
ns3_node = ns.network.NodeList.GetNode(self.selected_node.node_index)
finally:
self.simulation.lock.release()
self.ipython.updateNamespace({'selected_node': ns3_node})
示例3: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import new [as 別名]
def __init__(self, title=None):
""" Initializer
@param self: this object
@param title: title
"""
self.__title_text = None
gtk.widget_push_composite_child()
self.__title = gobject.new(gtk.Label, visible=True, xalign=0, yalign=0.5)
self.__indent = gobject.new(gtk.Label, visible=True, label=' ')
gtk.widget_pop_composite_child()
gtk.Bin.__init__(self)
self.__title.set_parent(self)
self.__indent.set_parent(self)
if title is not None:
self.props.title = title
示例4: __init__
# 需要導入模塊: import gobject [as 別名]
# 或者: from gobject import new [as 別名]
def __init__(self, title=None):
self.__title_text = None
gtk.widget_push_composite_child()
self.__title = gobject.new(gtk.Label, visible=True, xalign=0, yalign=0.5)
self.__indent = gobject.new(gtk.Label, visible=True, label=' ')
gtk.widget_pop_composite_child()
gtk.Bin.__init__(self)
self.__title.set_parent(self)
self.__indent.set_parent(self)
if title is not None:
self.props.title = title