using System; using Gtk; using Sexy; public class SexyIconEntryTest { public static void Main() { IconEntry icon_entry; Label label; Application.Init(); Window window = new Window("Sexy Icon Entry Test"); window.BorderWidth = 12; window.Destroyed += delegate(object o, EventArgs args) { Application.Quit(); }; Table table = new Table(2, 4, false); table.RowSpacing = 6; table.ColumnSpacing = 6; // Open File label = new Label("Open File:"); table.Attach(label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0); label.Xalign = 0.0f; icon_entry = new IconEntry(); table.Attach(icon_entry, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); icon_entry.SetIcon(IconEntryPosition.Primary, new Image(Stock.Open, IconSize.Menu)); icon_entry.SetIconHighlight(IconEntryPosition.Primary, true); // Open File label = new Label("Save File:"); table.Attach(label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0); label.Xalign = 0.0f; icon_entry = new IconEntry(); table.Attach(icon_entry, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); icon_entry.Text = "\u200fRight-to-Left"; icon_entry.Direction = TextDirection.Rtl; icon_entry.SetIcon(IconEntryPosition.Primary, new Image(Stock.Save, IconSize.Menu)); icon_entry.SetIconHighlight(IconEntryPosition.Primary, true); // Search label = new Label("Search:"); table.Attach(label, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0); label.Xalign = 0.0f; icon_entry = new IconEntry(); table.Attach(icon_entry, 1, 2, 2, 3, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); icon_entry.AddClearButton(); icon_entry.SetIcon(IconEntryPosition.Primary, new Image(Stock.Find, IconSize.Menu)); // Password label = new Label("Password:"); table.Attach(label, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 0, 0); label.Xalign = 0.0f; icon_entry = new IconEntry(); table.Attach(icon_entry, 1, 2, 3, 4, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); icon_entry.Visibility = false; icon_entry.SetIcon(IconEntryPosition.Primary, new Image("gtk-dialog-authentication", IconSize.Menu)); window.Add(table); window.ShowAll(); Application.Run(); } }