Add a demo font selection button and a spin button for scrollback

This commit is contained in:
Thomas Hurst 2008-08-24 07:39:49 +01:00
parent 0a6acc19dc
commit cac821f58a
1 changed files with 25 additions and 11 deletions

View File

@ -29,17 +29,31 @@ class ProfileEditor:
value = Defaults[key] value = Defaults[key]
widget = None widget = None
if type == "bool": if key == 'font':
widget = gtk.CheckButton () #widget = gtk.FontSelection()
widget.set_active (value) #widget.set_preview_text("Terminator: The robot future of terminals")
elif type in ["str", "int", "float"]: #widget.set_font_name(value)
widget = gtk.Entry () widget = gtk.FontButton(value)
widget.set_text (str(value)) elif key == 'scrollback_lines':
elif type == "list": # estimated byte size per line according to g-t:
continue # sizeof(void *) + sizeof(char *) + sizeof(int) + (80 * (sizeof(int32) + 4)
widget = gtk.SpinButton()
widget.set_digits(0)
widget.set_increments(100, 1000)
widget.set_range(0, 100000)
widget.set_value(value)
else: else:
print "Unknown type: " + type if type == "bool":
continue widget = gtk.CheckButton ()
widget.set_active (value)
elif type in ["str", "int", "float"]:
widget = gtk.Entry ()
widget.set_text (str(value))
elif type == "list":
continue
else:
print "Unknown type: " + type
continue
table.attach (label, 0, 1, row, row + 1) table.attach (label, 0, 1, row, row + 1)
table.attach (widget, 1, 2, row, row + 1) table.attach (widget, 1, 2, row, row + 1)