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


Python gtk.ANCHOR_N属性代码示例

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


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

示例1: _update_appearance

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ANCHOR_N [as 别名]
def _update_appearance(self):
        """Update the node aspect to reflect the selected/highlighted state"""

        size = transform_distance_simulation_to_canvas(self._size)
        if self.svg_item is not None:
            alpha = 0x80
        else:
            alpha = 0xff
        fill_color_rgba = (self._color & 0xffffff00) | alpha
        self.canvas_item.set_properties(radius_x=size, radius_y=size,
                                        fill_color_rgba=fill_color_rgba)
        if self._selected:
            line_width = size*.3
        else:
            line_width = size*.15
        if self.highlighted:
            stroke_color = 'yellow'
        else:
            stroke_color = 'black'
        self.canvas_item.set_properties(line_width=line_width, stroke_color=stroke_color)

        if self._label is not None:
            if self._label_canvas_item is None:
                self._label_canvas_item = goocanvas.Text(visibility_threshold=0.5,
                                                         font="Sans Serif 10",
                                                         fill_color_rgba=0x808080ff,
                                                         alignment=pango.ALIGN_CENTER,
                                                         anchor=gtk.ANCHOR_N,
                                                         parent=self.visualizer.canvas.get_root_item(),
                                                         pointer_events=0)
                self._label_canvas_item.lower(None)

            self._label_canvas_item.set_properties(visibility=goocanvas.ITEM_VISIBLE_ABOVE_THRESHOLD,
                                                   text=self._label)
            self._update_position() 
开发者ID:ntu-dsi-dcn,项目名称:ntu-dsi-dcn,代码行数:37,代码来源:core.py

示例2: _update_appearance

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ANCHOR_N [as 别名]
def _update_appearance(self):
        """!
        Update the node aspect to reflect the selected/highlighted state

        @param self: class object.
        @return none
        """

        size = transform_distance_simulation_to_canvas(self._size)
        if self.svg_item is not None:
            alpha = 0x80
        else:
            alpha = 0xff
        fill_color_rgba = (self._color & 0xffffff00) | alpha
        self.canvas_item.set_properties(radius_x=size, radius_y=size,
                                        fill_color_rgba=fill_color_rgba)
        if self._selected:
            line_width = size*.3
        else:
            line_width = size*.15
        if self.highlighted:
            stroke_color = 'yellow'
        else:
            stroke_color = 'black'
        self.canvas_item.set_properties(line_width=line_width, stroke_color=stroke_color)

        if self._label is not None:
            if self._label_canvas_item is None:
                self._label_canvas_item = goocanvas.Text(visibility_threshold=0.5,
                                                         font="Sans Serif 10",
                                                         fill_color_rgba=0x808080ff,
                                                         alignment=pango.ALIGN_CENTER,
                                                         anchor=gtk.ANCHOR_N,
                                                         parent=self.visualizer.canvas.get_root_item(),
                                                         pointer_events=0)
                self._label_canvas_item.lower(None)

            self._label_canvas_item.set_properties(visibility=goocanvas.ITEM_VISIBLE_ABOVE_THRESHOLD,
                                                   text=self._label)
            self._update_position() 
开发者ID:KTH,项目名称:royal-chaos,代码行数:42,代码来源:core.py


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