From f09f80cd65fd01d8e04a9ea58e3994589dc1ab90 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 18 Jun 2011 10:47:00 -0400 Subject: [PATCH] ocarina: Added library category to settings I'll eventually use this for controlling the library. Right now it's just an empty page. --- ocarina/settings/__init__.py | 17 +++++++++++++++-- ocarina/settings/library.py | 6 ++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 ocarina/settings/library.py diff --git a/ocarina/settings/__init__.py b/ocarina/settings/__init__.py index 4a5a85d9..61c58d5a 100644 --- a/ocarina/settings/__init__.py +++ b/ocarina/settings/__init__.py @@ -9,10 +9,14 @@ settings_page = gtk.VBox() settings_page.show() SETTINGS_PAGE = body.add_page(settings_page, "Settings") -close_button = gtk.Button("Close", gtk.STOCK_CLOSE) -settings_page.pack_start(close_button, False, False) +categories = gtk.Notebook() +settings_page.pack_start(categories, True, True) settings_page.show_all() +close_button = gtk.Button("Close", gtk.STOCK_CLOSE) +categories.set_action_widget(close_button, gtk.PACK_END) +close_button.show() + def hide_settings(*args): body.hide_page(SETTINGS_PAGE) body.switch_to_page_n(0) @@ -24,3 +28,12 @@ def show_settings(): def show_page(): show_settings() body.switch_to_page(SETTINGS_PAGE) + +def add_category(module): + label = gtk.Label(module.text) + label.show() + categories.append_page(module.page, label) + module.page.show() + +import library +add_category(library) diff --git a/ocarina/settings/library.py b/ocarina/settings/library.py new file mode 100644 index 00000000..4241b453 --- /dev/null +++ b/ocarina/settings/library.py @@ -0,0 +1,6 @@ +# Bryan Schumaker (6 / 18 / 2011) + +import gtk + +page = gtk.VBox() +text = "Library"