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


Python gtk.ScrolledWindow方法代码示例

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


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

示例1: _start_shell

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [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: _start_shell

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [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

示例3: display_text

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [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

示例4: _get_details_expander

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [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

示例5: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [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

示例6: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [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

示例7: createClockDisplayWidgets

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [as 别名]
def createClockDisplayWidgets(self):
		"""Create the Clock Display widgets."""
		self.tableClockDisplays = gtk.Table(rows=3, columns=3, homogeneous=False)
		self.tableClockDisplays.set_row_spacings(5)
		self.tableClockDisplays.set_col_spacings(5)
		
		createLabel(self.tableClockDisplays, text="Show", gridX=0, gridY=0, xPadding=10)
		self.clockCheckButton = createCheckButton(self.tableClockDisplays, active=True, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
		
		createLabel(self.tableClockDisplays, text="Time 1 Format", gridX=0, gridY=1, xPadding=10)
		self.clock1Format = createEntry(self.tableClockDisplays, maxSize=50, width=20, text=CLOCK_FMT_1, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
		self.clock1CheckButton = createCheckButton(self.tableClockDisplays, text="Show", active=True, gridX=2, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
		self.registerComponent("time1_format", self.clock1Format)
		
		createLabel(self.tableClockDisplays, text="Time 1 Font", gridX=0, gridY=2, xPadding=10)
		self.clock1FontButton = createFontButton(self.tableClockDisplays, font=self.defaults["font"], gridX=1, gridY=2, handler=self.changeOccurred)
		self.registerComponent("time1_font", self.clock1FontButton)
		
		createLabel(self.tableClockDisplays, text="Time 2 Format", gridX=0, gridY=3, xPadding=10)
		self.clock2Format = createEntry(self.tableClockDisplays, maxSize=50, width=20, text=CLOCK_FMT_2, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
		self.clock2CheckButton = createCheckButton(self.tableClockDisplays, text="Show", active=True, gridX=2, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
		self.registerComponent("time2_format", self.clock2Format)
		
		createLabel(self.tableClockDisplays, text="Time 2 Font", gridX=0, gridY=4, xPadding=10)
		self.clock2FontButton = createFontButton(self.tableClockDisplays, font=self.defaults["font"], gridX=1, gridY=4, handler=self.changeOccurred)
		self.registerComponent("time2_font", self.clock2FontButton)
		
		createLabel(self.tableClockDisplays, text="Tooltip Format", gridX=0, gridY=5, xPadding=10)
		self.clockTooltipFormat = createEntry(self.tableClockDisplays, maxSize=50, width=20, text=CLOCK_TOOLTIP, gridX=1, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
		self.clockTooltipCheckButton = createCheckButton(self.tableClockDisplays, text="Show", active=True, gridX=2, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
		self.registerComponent("clock_tooltip", self.clockTooltipFormat)
		
		self.clockArea = gtk.ScrolledWindow()
		self.clockBuf = gtk.TextBuffer()
		self.clockTextView = gtk.TextView(self.clockBuf)
		self.clockBuf.insert_at_cursor("%H 00-23 (24-hour)    %I 01-12 (12-hour)    %l 1-12 (12-hour)    %M 00-59 (minutes)\n%S 00-59 (seconds)    %P am/pm    %b Jan-Dec    %B January-December\n%a Sun-Sat    %A Sunday-Saturday    %d 01-31 (day)    %e 1-31 (day)\n%y 2 digit year, e.g. 09    %Y 4 digit year, e.g. 2009")
		self.clockTextView.set_editable(False)
		self.clockArea.add_with_viewport(self.clockTextView)
		self.tableClockDisplays.attach(self.clockArea, 0, 3, 6, 7, xpadding=10) 
开发者ID:milisarge,项目名称:malfs-milis,代码行数:41,代码来源:tintwizard.py

示例8: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [as 别名]
def __init__(self):
        assert Visualizer.INSTANCE is None
        Visualizer.INSTANCE = self
        super(Visualizer, self).__init__()
        self.nodes =  {} # node index -> Node
        self.channels = {} # id(ns3.Channel) -> Channel
        self.window = None # toplevel window
        self.canvas = None # goocanvas.Canvas
        self.time_label = None # gtk.Label
        self.play_button = None # gtk.ToggleButton
        self.zoom = None # gtk.Adjustment
        self._scrolled_window = None # gtk.ScrolledWindow

        self.links_group = goocanvas.Group()
        self.channels_group = goocanvas.Group()
        self.nodes_group = goocanvas.Group()

        self._update_timeout_id = None
        self.simulation = SimulationThread(self)
        self.selected_node = None # node currently selected
        self.speed = 1.0
        self.information_windows = []
        self._transmission_arrows = []
        self._last_transmissions = []
        self._drop_arrows = []
        self._last_drops = []
        self._show_transmissions_mode = None
        self.set_show_transmissions_mode(ShowTransmissionsMode.ALL)
        self._panning_state = None
        self.node_size_adjustment = None
        self.transmissions_smoothing_adjustment = None
        self.sample_period = SAMPLE_PERIOD
        self.node_drag_state = None
        self.follow_node = None
        self.shell_window = None

        self.create_gui()

        for plugin in plugins:
            plugin(self) 
开发者ID:ntu-dsi-dcn,项目名称:ntu-dsi-dcn,代码行数:42,代码来源:core.py

示例9: draw_gtk

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [as 别名]
def draw_gtk(p):
    win = gtk.Window()
    win.set_title('Family tree')
    win.connect('destroy', lambda widget: gtk.main_quit())

    sw = gtk.ScrolledWindow()
    win.add(sw)

    da = gtk.DrawingArea()

    def draw(widget, event):
        global ctx
        ctx = da.window.cairo_create()
        draw_tree(p)

        w = int(p.get('w') + 1)
        h = int(p.get('h') + 1)
        da.set_size_request(w, h)
        w = min(w, 1200)

        sw.set_size_request(w, h + 60)

    da.connect('expose_event', draw)
    sw.add_with_viewport(da)

    win.show_all()
    gtk.main() 
开发者ID:gramps-project,项目名称:addons-source,代码行数:29,代码来源:ft.py

示例10: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [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 ScrolledWindow [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: create_webview

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [as 别名]
def create_webview():
    """Create a gtk.Window containing a WebKit webview."""
    view = webkit.WebView()
    window = gtk.Window()
    scrolled = gtk.ScrolledWindow()
    scrolled.add(view)
    window.add(scrolled)
    return window, view 
开发者ID:ActiveState,项目名称:code,代码行数:10,代码来源:recipe-577167.py

示例13: __init__

# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import ScrolledWindow [as 别名]
def __init__(self, fontfile):

		self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
		self.window.set_title("%s - pyftinspect" % fontfile)
		self.window.connect("delete_event", self._delete_event)
		self.window.set_size_request(400, 600)

		self.scrolled_window = gtk.ScrolledWindow()
		self.window.add(self.scrolled_window)

		self.font = ttLib.TTFont(fontfile, lazy=True)
		self.treemodel = FontTreeModel(self.font)
		self.treeview = gtk.TreeView(self.treemodel)
		#self.treeview.set_reorderable(True)

		for i in range(2):
			col_name = ('Key', 'Value')[i]
			col = gtk.TreeViewColumn(col_name)
			col.set_sort_column_id(-1)
			self.treeview.append_column(col)

			cell = gtk.CellRendererText()
			col.pack_start(cell, True)
			col.add_attribute(cell, 'text', i)

		self.treeview.set_search_column(1)
		self.scrolled_window.add(self.treeview)
		self.window.show_all() 
开发者ID:MitchTalmadge,项目名称:Emoji-Tools,代码行数:30,代码来源:inspect.py


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