forked from buckyroberts/Source-Code-from-Tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path09_notebook.py
More file actions
29 lines (22 loc) · 928 Bytes
/
09_notebook.py
File metadata and controls
29 lines (22 loc) · 928 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="Notebook Demo")
self.set_border_width(10)
self.notebook = Gtk.Notebook()
self.add(self.notebook)
# First regular tab
self.page1 = Gtk.Box()
self.page1.set_border_width(10)
self.page1.add(Gtk.Label('Here is the content of the first section.'))
self.notebook.append_page(self.page1, Gtk.Label('First Tab'))
# Second star icon tab
self.page2 = Gtk.Box()
self.page2.set_border_width(10)
self.page2.add(Gtk.Label('This is what you will see when you click the star.'))
icon = Gtk.Image.new_from_icon_name("gnome-dev-cdrom-audio", Gtk.IconSize.MENU)
self.notebook.append_page(self.page2, icon)
window = MainWindow()
window.connect("delete-event", Gtk.main_quit)
window.show_all()
Gtk.main()