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


Python GObject.TYPE_PYOBJECT属性代码示例

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


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

示例1: __init__

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def __init__(self, model, view):
        assert isinstance(model, StateMachineManagerModel)
        tree_store = Gtk.TreeStore(GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_PYOBJECT, GObject.TYPE_STRING)
        super(StateMachineTreeController, self).__init__(model, view, view, tree_store)

        self.add_controller("state_right_click_ctrl", StateMachineTreeRightClickMenuController(model, view))

        self.view_is_registered = False

        # view.set_hover_expand(True)
        self.state_row_iter_dict_by_state_path = {}
        self.__my_selected_sm_id = None
        self._selected_sm_model = None

        self.__expansion_state = {}

        self._ongoing_complex_actions = []

        self._state_which_is_updated = None

        self.register() 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:23,代码来源:state_machine_tree.py

示例2: __init__

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def __init__(self, model, view):
        assert isinstance(model, AbstractStateModel)
        # initiate data base and tree
        # id, name, to-state, to-outcome, name-color, to-state-color, outcome, state, outcome_model
        list_store = Gtk.ListStore(int, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT,
                                   GObject.TYPE_PYOBJECT)
        super(StateOutcomesListController, self).__init__(model, view, view['tree_view'], list_store, logger)

        self.to_state_combo_list = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING)
        self.to_outcome_combo_list = Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING)
        # key-outcome_id -> label,  to_state_id,  transition_id
        self.dict_to_other_state = {}
        # key-outcome_id ->  label,  to_outcome_id,  transition_id
        self.dict_to_other_outcome = {}
        # not used at the moment key-outcome_id -> label,  from_state_id,  transition_id
        self.dict_from_other_state = {}  # if widget gets extended
        # TODO check why the can happen should not be handed always the LibraryStateModel
        if not (model.state.is_root_state or model.state.is_root_state_of_library):
            self.observe_model(model.parent)

        if self.model.get_state_machine_m() is not None:
            self.observe_model(self.model.get_state_machine_m())
        else:
            logger.warning("State model has no state machine model -> state model: {0}".format(self.model)) 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:26,代码来源:outcomes.py

示例3: __init__

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def __init__(self, model=None, view=None):
        assert isinstance(model, StateMachineManagerModel)
        assert isinstance(view, ExecutionHistoryView)

        super(ExecutionHistoryTreeController, self).__init__(model, view)
        self.history_tree_store = Gtk.TreeStore(GObject.TYPE_STRING, GObject.TYPE_PYOBJECT, GObject.TYPE_STRING)
        # a TreeView
        self.history_tree = view['history_tree']
        self.history_tree.set_model(self.history_tree_store)
        view['history_tree'].set_tooltip_column(self.TOOL_TIP_STORAGE_ID)

        self.observe_model(state_machine_execution_model)
        self._expansion_state = {}
        self._update_lock = RLock()

        self.update() 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:18,代码来源:execution_history.py

示例4: __init__

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def __init__(self, model, view):
        assert isinstance(model, LibraryManagerModel)
        assert isinstance(view, Gtk.TreeView)
        ExtendedController.__init__(self, model, view)
        self.tree_store = Gtk.TreeStore(GObject.TYPE_STRING, GObject.TYPE_PYOBJECT, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING)
        view.set_model(self.tree_store)
        view.set_tooltip_column(3)

        # Gtk TODO: solve via Gtk.TargetList? https://python-gtk-3-tutorial.readthedocs.io/en/latest/drag_and_drop.html
        view.drag_source_set(Gdk.ModifierType.BUTTON1_MASK, [Gtk.TargetEntry.new('STRING', 0, 0)], Gdk.DragAction.COPY)

        self.library_row_iter_dict_by_library_path = {}
        self.__expansion_state = None

        self.update() 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:17,代码来源:library_tree.py

示例5: _get_new_list_store

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def _get_new_list_store():
        return Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, int, bool, GObject.TYPE_STRING, GObject.TYPE_PYOBJECT) 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:4,代码来源:io_data_port_list.py

示例6: get_new_list_store

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def get_new_list_store():
        return Gtk.ListStore(GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, int, GObject.TYPE_PYOBJECT) 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:4,代码来源:scoped_variable_list.py

示例7: __init__

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def __init__(self, model, view):
        """Constructor
        """
        # ListStore for: id, from-state, from-key, to-state, to-key, is_external,
        #                   name-color, to-state-color, data-flow-object, state-object, is_editable, data-flow-model
        list_store = Gtk.ListStore(int, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, bool, GObject.TYPE_STRING, GObject.TYPE_STRING,
                               GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT, bool, GObject.TYPE_PYOBJECT)
        self.view_dict = {'data_flows_internal': True, 'data_flows_external': True}

        self.tree_dict_combos = {'internal': {},
                                 'external': {}}
        self.data_flow_dict = {'internal': {},
                               'external': {}}
        self.debug_log = False
        super(StateDataFlowsListController, self).__init__(model, view, view.get_top_widget(), list_store, logger) 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:17,代码来源:data_flows.py

示例8: __init__

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def __init__(self, model, view):
        # ListStore for: id, from-state, from-outcome, to-state, to-outcome, is_external,
        #                   name-color, to-state-color, transition-object, state-object, is_editable, transition-model
        list_store = Gtk.ListStore(int, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, bool,
                                   GObject.TYPE_PYOBJECT, GObject.TYPE_PYOBJECT, bool, GObject.TYPE_PYOBJECT)

        self.view_dict = {'transitions_internal': True, 'transitions_external': True}
        self.combo = {}
        self.debug_log = False
        super(StateTransitionsListController, self).__init__(model, view, view.get_top_widget(), list_store, logger) 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:12,代码来源:transitions.py

示例9: __init__

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def __init__(self, model, view):
        """Constructor
        :param model StateMachineModel should be exchangeable
        """
        assert isinstance(model, StateMachineManagerModel)

        ExtendedController.__init__(self, model, view)
        self.view_is_registered = False

        self._mode = 'branch'
        self.with_tree = True
        self.tree_folded = False

        assert self._mode in ['trail', 'branch']
        self.history_tree_store = Gtk.TreeStore(GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_STRING, GObject.TYPE_PYOBJECT, GObject.TYPE_STRING, GObject.TYPE_STRING)
        if view is not None:
            view['history_tree'].set_model(self.history_tree_store)
        view['history_tree'].set_tooltip_column(8)

        # view.set_hover_expand(True)

        self.__my_selected_sm_id = None
        self._selected_sm_model = None

        self.doing_update = False
        self.no_cursor_observation = False
        self.next_activity_focus_self = True
        self.on_toggle_mode_check_gaphas_view_is_meta_data_consistent = True

        self.register() 
开发者ID:DLR-RM,项目名称:RAFCON,代码行数:32,代码来源:modification_history.py

示例10: tags_treeview

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def tags_treeview(self, tree):
        desc = {}

        # Tag id
        col_name = 'tag_id'
        col = {}
        col['renderer'] = ['markup', Gtk.CellRendererText()]
        col['value'] = [str, lambda node: node.get_id()]
        col['visible'] = False
        col['order'] = 0
        col['sorting_func'] = self.tag_sorting
        desc[col_name] = col

        # Tags color
        col_name = 'color'
        col = {}
        render_tags = CellRendererTags()
        render_tags.set_property('ypad', 5)
        col['title'] = _("Tags")
        col['renderer'] = ['tag', render_tags]
        col['value'] = [GObject.TYPE_PYOBJECT, lambda node: node]
        col['expandable'] = False
        col['resizable'] = False
        col['order'] = 1
        desc[col_name] = col

        # Tag names
        col_name = 'tagname'
        col = {}
        render_text = Gtk.CellRendererText()
        render_text.set_property('ypad', 5)
        col['renderer'] = ['markup', render_text]
        col['value'] = [str, self.get_tag_name]
        col['expandable'] = True
        col['new_column'] = False
        col['order'] = 2
        desc[col_name] = col

        # Tag count
        col_name = 'tagcount'
        col = {}
        render_text = Gtk.CellRendererText()
        render_text.set_property('xpad', 17)
        render_text.set_property('ypad', 5)
        render_text.set_property('xalign', 1)
        col['renderer'] = ['markup', render_text]
        col['value'] = [str, self.get_tag_count]
        col['expandable'] = False
        col['new_column'] = False
        col['order'] = 3
        desc[col_name] = col

        return self.build_tag_treeview(tree, desc) 
开发者ID:getting-things-gnome,项目名称:gtg,代码行数:55,代码来源:treeview_factory.py

示例11: common_desc_for_tasks

# 需要导入模块: from gi.repository import GObject [as 别名]
# 或者: from gi.repository.GObject import TYPE_PYOBJECT [as 别名]
def common_desc_for_tasks(self, tree, title_label):
        desc = {}

        # invisible 'task_id' column
        col_name = 'task_id'
        col = {}
        col['renderer'] = ['markup', Gtk.CellRendererText()]
        col['value'] = [str, lambda node: node.get_id()]
        col['visible'] = False
        col['order'] = 0
        desc[col_name] = col

        # invisible 'bg_color' column
        col_name = 'bg_color'
        col = {}
        col['value'] = [str, lambda node: None]
        col['visible'] = False
        desc[col_name] = col

        # invisible 'title' column
        col_name = 'title'
        col = {}
        render_text = Gtk.CellRendererText()
        render_text.set_property("ellipsize", Pango.EllipsizeMode.END)
        col['renderer'] = ['markup', render_text]
        col['value'] = [str, self.get_task_title_column_string]
        col['visible'] = False
        col['order'] = 0
        col['sorting_func'] = self.sort_by_title
        desc[col_name] = col

        # "tags" column (no title)
        col_name = 'tags'
        col = {}
        render_tags = CellRendererTags()
        render_tags.set_property('xalign', 0.0)
        col['renderer'] = ['tag_list', render_tags]
        col['value'] = [GObject.TYPE_PYOBJECT, self.get_task_tags_column_contents]
        col['expandable'] = False
        col['resizable'] = False
        col['order'] = 1
        desc[col_name] = col

        # "label" column
        col_name = 'label'
        col = {}
        col['title'] = title_label
        render_text = Gtk.CellRendererText()
        render_text.set_property("ellipsize", Pango.EllipsizeMode.END)
        col['renderer'] = ['markup', render_text]
        col['value'] = [str, self.get_task_label_column_string]
        col['expandable'] = True
        col['resizable'] = True
        col['sorting'] = 'title'
        col['order'] = 2
        desc[col_name] = col
        return desc 
开发者ID:getting-things-gnome,项目名称:gtg,代码行数:59,代码来源:treeview_factory.py


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