All pastes #985623 Raw Edit

nrayever pygtk

public text v1 · immutable
·published 2008-04-15 05:00 UTC
rendered paste body
#!/usr/bin/env python

# example notebook.py

import pygtk
pygtk.require('2.0')
import gtk

class NotebookExample:
    def delete(self, widget, event=None):
        gtk.main_quit()
        return False

    def __init__(self):
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.connect("delete_event", self.delete)
        window.set_border_width(10)

        table = gtk.Table(2,1,False)
        window.add(table)

        # Create a new notebook, place the position of the tabs
        notebook = gtk.Notebook()
        notebook.set_tab_pos(gtk.POS_TOP)
        table.attach(notebook, 0,1,1,2)
        notebook.show_all()
        self.show_tabs = True
        self.show_border = True

        # Let's append a bunch of pages to the notebook
        def labels():
            #for i in range(4):
        #    bufferf = ''#Append Frame %d" % (i+1)
        #    bufferl = "Page %d" % (i+1)

                #tag = gtk.Label("solo texto")
            frame = gtk.Frame(label = None)
            frame.set_border_width(10)
            frame.set_size_request(100, 75)
                #ntable = gtk.Table(2,2,False)
                #ntable.attach(tag,0,0,0,0)
                #ntable.show()
                #frame.add(ntable)
            frame.show()
                
                #if i == 0:
            label = gtk.Label("Differencial Pair Match Calculator")
            notebook.append_page(frame, label)
            #frame.add(label)
            label.show()
            #call notebook.show_all()
                #elif i == 1:
            label = gtk.Label("Manual Bump Calculator")
            notebook.append_page(frame, label)
            #frame.add(label)
            label.show()
            #call notebook.show_all()
                #elif i == 2:
            label = gtk.Label("Inter Pair Space Calculator")
            notebook.append_page(frame, label)
            #frame.add(label)
            label.show()
            #call notebook.show_all()
                #else:
            label = gtk.Label("Pin Delay Calculator")
            notebook.append_page(frame, label)
            #frame.add(label)
            label.show()
            #call notebook.show_all()
                #notebook.append_page(frame, label)
        #    label = gtk.Label(bufferf)
        #    frame.add(label)
        #    label.show()

        #    label = gtk.Label(bufferl)
        #    notebook.append_page(frame, label)
      
        labels()
        table.show()
        window.show()