Exemple #1
0
        private void InitGui()
        {
            //genre button
            Gtk.Image square     = new Gtk.Image(null, "Wikipedia-logo-small.png");
            Gtk.HBox  genre_hbox = new HBox(false, 0);
            genre_hbox.Add(square);
            genre_hbox.Add(new Label(Catalog.GetString("Genre")));
            genre_button        = new Gtk.Button(genre_hbox);
            genre_button.Relief = ReliefStyle.None;

            // artist
            Gtk.HBox artist_hbox = new HBox(false, 0);
            artist_hbox.Add(new Gtk.Image(null, "Wikipedia-logo-small.png"));
            artist_hbox.Add(new Label(Catalog.GetString("Artist")));
            artist_button        = new Gtk.Button(artist_hbox);
            artist_button.Relief = ReliefStyle.None;

            //album button
            Gtk.HBox album_hbox = new HBox(false, 0);
            album_hbox.Add(new Gtk.Image(null, "Wikipedia-logo-small.png"));
            album_hbox.Add(new Label(Catalog.GetString("Album")));
            album_button        = new Gtk.Button(album_hbox);
            album_button.Relief = ReliefStyle.None;

            //lyrics button
            Gtk.HBox lyric_hbox = new HBox(false, 0);
            lyric_hbox.Add(new Gtk.Image(null, "lyrics.png"));
            lyric_hbox.Add(new Label(Catalog.GetString("Lyrics")));
            lyric_button        = new Gtk.Button(lyric_hbox);
            lyric_button.Relief = ReliefStyle.None;

            // Button bar
            Gtk.HButtonBox hb = new Gtk.HButtonBox();
            hb.Layout  = Gtk.ButtonBoxStyle.Start;
            hb.Spacing = 5;
            hb.Add(artist_button);
            hb.Add(album_button);
            hb.Add(genre_button);
            hb.Add(lyric_button);

            // hide/show button
            hide_show_button          = new Gtk.Button(new Gtk.Image(null, "minus.png"));
            hide_show_button.Relief   = ReliefStyle.None;
            hide_show_button.Clicked += new EventHandler(OnHideShowClicked);
            this.minimized            = false;

            //search label
            Gtk.Label search_l = new Gtk.Label();
            search_l.Markup = "<b>" + Catalog.GetString("Search") + ":</b>";

            // upper hbox
            Gtk.HBox toolbar = new Gtk.HBox(false, 5);
            toolbar.PackStart(new Gtk.Image(Stock.Info, IconSize.Menu), false, false, 5);
            toolbar.PackStart(search_l, false, false, 5);
            toolbar.PackStart(hb, true, true, 0);
            toolbar.PackStart(hide_show_button, false, false, 0);


            this.wb = new ContextBrowser();

            //main = new Gtk.VBox(false,5);
            this.PackStart(toolbar, false, false, 0);
            this.PackEnd(wb, true, true, 5);
            //this.Add(main);
            this.HeightRequest = 400;
            //hb.Show();
            //this.wb.Show();

            //this.main.Show();
            this.Show();
        }
        private void InitGui()
        {
            //genre button
            Gtk.Image square = new Gtk.Image(null,"Wikipedia-logo-small.png");
            Gtk.HBox genre_hbox = new HBox(false,0);
            genre_hbox.Add(square);
            genre_hbox.Add(new Label(Catalog.GetString("Genre")));
            genre_button = new Gtk.Button(genre_hbox);
            genre_button.Relief = ReliefStyle.None;

            // artist
            Gtk.HBox artist_hbox = new HBox(false,0);
            artist_hbox.Add(new Gtk.Image(null,"Wikipedia-logo-small.png"));
            artist_hbox.Add(new Label(Catalog.GetString("Artist")));
            artist_button = new Gtk.Button(artist_hbox);
            artist_button.Relief = ReliefStyle.None;

            //album button
            Gtk.HBox album_hbox = new HBox(false,0);
            album_hbox.Add(new Gtk.Image(null,"Wikipedia-logo-small.png"));
            album_hbox.Add(new Label(Catalog.GetString("Album")));
            album_button = new Gtk.Button(album_hbox);
            album_button.Relief = ReliefStyle.None;

            //lyrics button
            Gtk.HBox lyric_hbox = new HBox(false,0);
            lyric_hbox.Add(new Gtk.Image(null,"lyrics.png"));
            lyric_hbox.Add(new Label(Catalog.GetString("Lyrics")));
            lyric_button = new Gtk.Button(lyric_hbox);
            lyric_button.Relief = ReliefStyle.None;

            // Button bar
            Gtk.HButtonBox hb = new Gtk.HButtonBox();
            hb.Layout  = Gtk.ButtonBoxStyle.Start;
            hb.Spacing = 5;
            hb.Add(artist_button);
            hb.Add(album_button);
            hb.Add(genre_button);
            hb.Add(lyric_button);

            // hide/show button
            hide_show_button          = new Gtk.Button(new Gtk.Image(null,"minus.png"));
            hide_show_button.Relief   = ReliefStyle.None;
            hide_show_button.Clicked += new EventHandler(OnHideShowClicked);
            this.minimized = false;

            //search label
            Gtk.Label search_l = new Gtk.Label();
            search_l.Markup = "<b>"+Catalog.GetString("Search")+":</b>";

            // upper hbox
            Gtk.HBox toolbar = new Gtk.HBox(false,5);
            toolbar.PackStart(new Gtk.Image(Stock.Info,IconSize.Menu),false,false,5);
            toolbar.PackStart(search_l,false,false,5);
            toolbar.PackStart(hb,true,true,0);
            toolbar.PackStart(hide_show_button,false,false,0);

            this.wb = new ContextBrowser();

            //main = new Gtk.VBox(false,5);
            this.PackStart(toolbar,false,false,0);
            this.PackEnd(wb,true,true,5);
            //this.Add(main);
            this.HeightRequest = 400;
            //hb.Show();
            //this.wb.Show();

            //this.main.Show();
            this.Show();
        }