Python gtk.TextBuffer() Examples
The following are 5
code examples of gtk.TextBuffer().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
gtk
, or try the search function
.
Example #1
Source File: views.py From nightmare with GNU General Public License v2.0 | 5 votes |
def vwSetTagTable(self, tagtable): self.tagtable = tagtable self.textbuf = gtk.TextBuffer(self.tagtable) self.textview.set_buffer(self.textbuf)
Example #2
Source File: tintwizard.py From malfs-milis with MIT License | 5 votes |
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)
Example #3
Source File: recipe-355203.py From code with MIT License | 5 votes |
def __init__(self): filename = 'dndtester.glade' windowname = 'DNDTester' self.wTree = gtk.glade.XML(filename, windowname) self.log_buffer = gtk.TextBuffer() self.setupWidgets()
Example #4
Source File: message_label.py From gimp-plugin-export-layers with GNU General Public License v3.0 | 5 votes |
def _on_button_more_clicked(self, button): lines = list(self._popup_text_lines) if (pg.gui.get_label_full_text_width(self._label_message) > self._label_message.get_allocation().width): lines.insert(0, self._label_text) text = "\n".join(lines).strip() text_buffer = gtk.TextBuffer() text_buffer.set_text(text.encode(pg.GTK_CHARACTER_ENCODING)) self._text_view_more.set_buffer(text_buffer) self._popup_more.move(*pg.gui.get_position_below_widget(self)) self._popup_more.show()
Example #5
Source File: radmin.py From rpy2 with GNU General Public License v2.0 | 4 votes |
def __init__(self): super(ConsolePanel, self).__init__() self._history = ['', ] * ConsolePanel.MAX_HISTORY self._history_i = 0 s_window = gtk.ScrolledWindow() s_window.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) s_window.show() t_table = gtk.TextTagTable() tag_out=gtk.TextTag("output") tag_out.set_property("foreground","blue") tag_out.set_property("font","monospace 10") tag_out.set_property("editable", False) t_table.add(tag_out) tag_in=gtk.TextTag("input") tag_in.set_property("foreground","black") tag_in.set_property("font","monospace 10") t_table.add(tag_in) self.tag_table = t_table self._buffer = gtk.TextBuffer(t_table) self._view = gtk.TextView(buffer = self._buffer) self._view.connect("key_press_event", self.actionKeyPress) self._view.show() s_window.add(self._view) self.add(s_window) evalButton = gtk.Button("Evaluate") evalButton.connect("clicked", self.evaluateAction, "evaluate") #evalButton.show() self.pack_start(evalButton, False, False, 0) self._evalButton = evalButton console_info = gtk.Label('') self._console_info = console_info self.update_consoleinfo() console_info.show() self.pack_start(console_info, False, False, 0) self.append("> ", "input") location = self._buffer.get_end_iter() self._start_mark = self._buffer.create_mark("beginCode", location, left_gravity=True) self._firstEnter = False