From 381b72aea4f430b2854f3a7fb01953e7af259f1a Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 18 Jun 2011 10:36:19 -0400 Subject: [PATCH] ocarina: Show and hide settings page I don't have any settings here yet, but it's coming. For now, it's good enough to be able to open and close a tab. --- ocarina/settings/__init__.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/ocarina/settings/__init__.py b/ocarina/settings/__init__.py index 64f33733..4a5a85d9 100644 --- a/ocarina/settings/__init__.py +++ b/ocarina/settings/__init__.py @@ -1,5 +1,26 @@ # Bryan Schumaker (6 / 18 / 2011) +import gtk + +from ocarina import sources +from ocarina import body + +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) +settings_page.show_all() + +def hide_settings(*args): + body.hide_page(SETTINGS_PAGE) + body.switch_to_page_n(0) +close_button.connect("clicked", hide_settings) + +def show_settings(): + body.show_page(SETTINGS_PAGE) def show_page(): - print "Showing settings page!" + show_settings() + body.switch_to_page(SETTINGS_PAGE)