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


Python gtk.POLICY_AUTOMATIC属性代码示例

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


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

示例1: _start_shell

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def _start_shell(self, dummy_button):
        if self.shell_window is not None:
            self.shell_window.present()
            return
        
        self.shell_window = gtk.Window()
        self.shell_window.set_size_request(750,550)
        self.shell_window.set_resizable(True)
        scrolled_window = gtk.ScrolledWindow()
        scrolled_window.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
        ipython = ipython_view.IPythonView()
        ipython.modify_font(pango.FontDescription(SHELL_FONT))
        ipython.set_wrap_mode(gtk.WRAP_CHAR)
        ipython.show()
        scrolled_window.add(ipython)
        scrolled_window.show()
        self.shell_window.add(scrolled_window)
        self.shell_window.show()
        self.shell_window.connect('destroy', self._on_shell_window_destroy)

        self._update_ipython_selected_node()
        __IPYTHON__.user_ns['viz'] = self 
开发者ID:ntu-dsi-dcn,项目名称:ntu-dsi-dcn,代码行数:24,代码来源:core.py

示例2: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def __init__(self):
            super(ShowLastPackets.PacketList, self).__init__()
            self.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
                                vscrollbar_policy=gtk.POLICY_AUTOMATIC)
            self.table_model = gtk.ListStore(*([str]*4))
            treeview = gtk.TreeView(self.table_model)
            treeview.show()
            self.add(treeview)

            def add_column(descr, colid):
                column = gtk.TreeViewColumn(descr, gtk.CellRendererText(), text=colid)
                treeview.append_column(column)

            add_column("Time", self.COLUMN_TIME)
            add_column("Interface", self.COLUMN_INTERFACE)
            add_column("Size", self.COLUMN_SIZE)
            add_column("Contents", self.COLUMN_CONTENTS) 
开发者ID:ntu-dsi-dcn,项目名称:ntu-dsi-dcn,代码行数:19,代码来源:show_last_packets.py

示例3: _start_shell

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def _start_shell(self, dummy_button):
        if self.shell_window is not None:
            self.shell_window.present()
            return
        
        self.shell_window = gtk.Window()
        self.shell_window.set_size_request(750,550)
        self.shell_window.set_resizable(True)
        scrolled_window = gtk.ScrolledWindow()
        scrolled_window.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
        self.ipython = ipython_view.IPythonView()
        self.ipython.modify_font(pango.FontDescription(SHELL_FONT))
        self.ipython.set_wrap_mode(gtk.WRAP_CHAR)
        self.ipython.show()
        scrolled_window.add(self.ipython)
        scrolled_window.show()
        self.shell_window.add(scrolled_window)
        self.shell_window.show()
        self.shell_window.connect('destroy', self._on_shell_window_destroy)

        self._update_ipython_selected_node()
        self.ipython.updateNamespace({'viz': self}) 
开发者ID:imec-idlab,项目名称:IEEE-802.11ah-ns-3,代码行数:24,代码来源:core.py

示例4: display_text

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def display_text(self, title, text, parent=None, modal=False):
        dialog = InfoDialog(title, None, parent, modal)
        text_view = gtk.TextView()
        text_view.get_buffer().set_text(text)
        text_view.set_editable(False)
        text_view.set_cursor_visible(False)
        text_view.show()
        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        sw.show()
        sw.add(text_view)
        detail_view = gtk.Frame()
        detail_view.set_shadow_type(gtk.SHADOW_IN)
        detail_view.add(sw)
        detail_view.set_border_width(6)
        dialog.vbox.add(detail_view)
        detail_view.show()
        text_view.set_size_request(485, 300)
        dialog.run_async()
        return 
开发者ID:Laharah,项目名称:deluge-FileBotTool,代码行数:22,代码来源:user_messenger.py

示例5: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def __init__(self):
            """
            Initializer
            @param self this object
            """
            super(ShowLastPackets.PacketList, self).__init__()
            self.set_properties(hscrollbar_policy=gtk.POLICY_AUTOMATIC,
                                vscrollbar_policy=gtk.POLICY_AUTOMATIC)
            self.table_model = gtk.ListStore(*([str]*4))
            treeview = gtk.TreeView(self.table_model)
            treeview.show()
            self.add(treeview)

            def add_column(descr, colid):
                column = gtk.TreeViewColumn(descr, gtk.CellRendererText(), text=colid)
                treeview.append_column(column)

            add_column("Time", self.COLUMN_TIME)
            add_column("Interface", self.COLUMN_INTERFACE)
            add_column("Size", self.COLUMN_SIZE)
            add_column("Contents", self.COLUMN_CONTENTS) 
开发者ID:KTH,项目名称:royal-chaos,代码行数:23,代码来源:show_last_packets.py

示例6: _get_details_expander

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def _get_details_expander(details_text, details_label):
  expander = gtk.Expander()
  expander.set_use_markup(True)
  expander.set_label("<b>" + details_label + "</b>")
  
  scrolled_window = gtk.ScrolledWindow()
  scrolled_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
  scrolled_window.set_size_request(400, 200)
  scrolled_window.set_shadow_type(gtk.SHADOW_IN)
  
  exception_text_view = gtk.TextView()
  exception_text_view.set_editable(False)
  exception_text_view.set_wrap_mode(gtk.WRAP_WORD)
  exception_text_view.set_cursor_visible(False)
  exception_text_view.set_pixels_above_lines(1)
  exception_text_view.set_pixels_below_lines(1)
  exception_text_view.set_pixels_inside_wrap(0)
  exception_text_view.set_left_margin(5)
  exception_text_view.set_right_margin(5)
  exception_text_view.get_buffer().set_text(details_text)
  
  scrolled_window.add(exception_text_view)
  expander.add(scrolled_window)
  
  return expander 
开发者ID:khalim19,项目名称:gimp-plugin-export-layers,代码行数:27,代码来源:_gui_messages.py

示例7: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def __init__(self, item_spacing=ITEM_SPACING, *args, **kwargs):
    super().__init__(*args, **kwargs)
    
    self._item_spacing = item_spacing
    
    self._drag_and_drop_context = draganddropcontext_.DragAndDropContext()
    self._items = []
    
    self._vbox_items = gtk.VBox(homogeneous=False)
    self._vbox_items.set_spacing(self._item_spacing)
    
    self._vbox = gtk.VBox(homogeneous=False)
    self._vbox.set_spacing(self.VBOX_SPACING)
    self._vbox.pack_start(self._vbox_items, expand=False, fill=False)
    
    self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
    self.add_with_viewport(self._vbox)
    self.get_child().set_shadow_type(gtk.SHADOW_NONE) 
开发者ID:khalim19,项目名称:gimp-plugin-export-layers,代码行数:20,代码来源:itembox.py

示例8: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def __init__(self):
        super(CodePanel, self).__init__()
        label = gtk.Label("Enter R code to evaluate")
        label.show()
        self.pack_start(label, False, True, 0)
        s_window = gtk.ScrolledWindow()
        s_window.set_policy(gtk.POLICY_AUTOMATIC, 
                            gtk.POLICY_AUTOMATIC)
        s_window.show()
        self._rpad = gtk.TextView(buffer=None)
        self._rpad.set_editable(True)
        self._rpad.show()
        s_window.add(self._rpad)
        self.add(s_window)
        evalButton = gtk.Button("Evaluate highlighted code")
        evalButton.connect("clicked", self.evaluateAction, "evaluate")
        evalButton.show()
        self.pack_start(evalButton, False, False, 0)
        self._evalButton = evalButton 
开发者ID:rpy2,项目名称:rpy2,代码行数:21,代码来源:radmin.py

示例9: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def __init__(self, closable=True):
        gtk.ScrolledWindow.__init__(self)
        self.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.vwactive = True
        self.vwname = None
        self.closable = closable
        self.connect("destroy", self.vwDestroy) 
开发者ID:joxeankoret,项目名称:nightmare,代码行数:9,代码来源:views.py

示例10: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def __init__(self, items=()):
        gtk.Dialog.__init__(self)
        self.ret = None
        self._started = 0
        self.connect("destroy", self.quit)
        self.connect("delete_event", self.quit)
        self.set_geometry_hints(min_width=250, min_height=300)
        scrolled_win = gtk.ScrolledWindow()
        scrolled_win.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        scrolled_win.show()
        self.vbox.pack_start(scrolled_win)
        #self.vbox.show()

        button = gtk.Button("Cancel")
        button.connect("clicked", self.cancel)
        button.set_flags(gtk.CAN_DEFAULT)
        self.action_area.pack_start(button)
        button.show()

        ls = gtk.ListStore(gobject.TYPE_STRING)
        for item in items:
            iter = ls.append()
            ls.set(iter, 0, item)

        lister = gtk.TreeView(ls)
        selection = lister.get_selection()
        selection.set_mode(gtk.SELECTION_BROWSE)
        selection.unselect_all()
        lister.set_search_column(0)
        scrolled_win.add_with_viewport(lister)

        column = gtk.TreeViewColumn('Keyword', gtk.CellRendererText(), text=0)
        lister.append_column(column)
        lister.set_headers_visible(False)
        lister.connect("row-activated", self.row_activated)
        lister.show() 
开发者ID:kdart,项目名称:pycopia,代码行数:38,代码来源:gtktools.py

示例11: show_new_files

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def show_new_files(self, files):
        """
        Given a list of new files, display message showing them to the user
        Args:
            files: list of files or file => linked file pairs
        """
        message = """FileBot has created the following new files:\n"""
        title = "New Files Created"
        dialog = InfoDialog(title, message)
        files = [' => '.join(f) if isinstance(f, tuple) else f for f in files]
        files = pprint.pformat(files)
        text_view = gtk.TextView()
        text_view.get_buffer().set_text(files)
        text_view.set_editable(False)
        text_view.set_cursor_visible(False)
        text_view.show()
        sw = gtk.ScrolledWindow()
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        sw.show()
        sw.add(text_view)
        detail_view = gtk.Frame()
        detail_view.set_shadow_type(gtk.SHADOW_IN)
        detail_view.add(sw)
        detail_view.set_border_width(6)
        dialog.vbox.add(detail_view)
        text_view.set_size_request(485, 300)
        detail_view.show()
        dialog.run_async()
        return 
开发者ID:Laharah,项目名称:deluge-FileBotTool,代码行数:31,代码来源:user_messenger.py

示例12: scrollify

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import POLICY_AUTOMATIC [as 别名]
def scrollify(widget):
    #widget.set_word_wrap(gtk.TRUE)
    scrl=gtk.GtkScrolledWindow()
    scrl.add(widget)
    scrl.set_policy(gtk.POLICY_NEVER, gtk.POLICY_ALWAYS)
    # scrl.set_update_policy(gtk.POLICY_AUTOMATIC)
    return scrl 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:9,代码来源:gtkutil.py


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