/// <summary>Display bookmark list to the XWT Box as an array of Buttons</summary> /// <param name="box">The XWT box</param> /// <param name="OnClick">What should happen if user clicks the bookmark</param> /// <param name="s">The Stylist that should apply usertheme to the button (or null)</param> public void DisplayBookmarks(Xwt.Box box, Action<string> OnClick, Stylist s = null) { if(s==null) s = new Stylist(); box.Clear(); foreach (Bookmark b in bookmarks) { string url = b.url; Xwt.Button NewBtn = new Xwt.Button(null, b.title); NewBtn.Clicked += (o, ea) => { OnClick(url); }; NewBtn.CanGetFocus = false; NewBtn.Style = Xwt.ButtonStyle.Flat; NewBtn.Margin = -3; NewBtn.Cursor = Xwt.CursorType.Hand; NewBtn.Image = b.GetIcon(); s.Stylize(NewBtn); box.PackStart(NewBtn); } }