Archive / / / / / Echo.UI.Preferences.PreferencesWindow.vala
2008-11-27 23:48:48 UTC
previous next
/* vim: set noexpandtab tabstop=4 shiftwidth=4 nowrap textwidth=100 * * Echo Media Player * Copyright (C) 2008 Shane O'Connell * * [ The original file includes a copyright header in this location describing * the file as being released under the terms of the GNU General Public * License. It has been removed in order to display the file as part of the * archive. ] */ public class Echo.UI.Preferences.PreferencesWindow : Gtk.Window { private Gtk.Notebook _notebook; public static void create(Gtk.Window parent) { var prefs = new PreferencesWindow(); prefs.set_transient_for(parent); prefs.set_destroy_with_parent(true); prefs.set_position(Gtk.WindowPosition.CENTER_ON_PARENT); prefs.show_all(); } public PreferencesWindow() { _notebook = new Gtk.Notebook(); this.title = "Preferences"; this.set_default_size(500, 300); add_tab(new GeneralTab()); add_tab(new LibrariesTab()); this.add(_notebook); } private void add_tab(IPreferencesTab tab) { Gtk.HBox label = new Gtk.HBox(false, 5); //Gtk.HBox menu_label = new Gtk.HBox(false, 5); Gtk.Image icon = new Gtk.Image.from_icon_name(tab.icon, Gtk.IconSize.MENU); //Gtk.Image menu_icon = new Gtk.Image.from_icon_name(tab.get_icon(), Gtk.IconSize.MENU); label.pack_start(icon, false, false, 0); label.pack_start(new Gtk.Label(tab.name), false, false, 0); label.show_all(); //menu_label.pack_start(menu_icon, false, false, 0); //menu_label.pack_start(new Gtk.Label(tab.get_name()), false, false, 0); //menu_label.show_all(); _notebook.append_page(tab, label); tab.show_all(); } }