public static Gtk.Window Create () { window = new Dialog (); window.Title = "Bi-directional flipping"; window.SetDefaultSize (200, 100); label = new Label ("Label direction: <b>Left-to-right</b>"); label.UseMarkup = true; label.SetPadding (3, 3); window.VBox.PackStart (label, true, true, 0); check_button = new CheckButton ("Toggle label direction"); window.VBox.PackStart (check_button, true, true, 2); if (window.Direction == TextDirection.Ltr) check_button.Active = true; check_button.Toggled += new EventHandler (Toggle_Flip); check_button.BorderWidth = 10; button = new Button (Stock.Close); button.Clicked += new EventHandler (Close_Button); button.CanDefault = true; window.ActionArea.PackStart (button, true, true, 0); button.GrabDefault (); window.ShowAll (); return window; }
public static Gtk.Window Create () { window = new Dialog (); window.Response += new ResponseHandler (Print_Response); window.SetDefaultSize (200, 100); window.Title = "GtkDialog"; Button button = new Button (Stock.Ok); button.Clicked += new EventHandler (Close_Button); button.CanDefault = true; window.ActionArea.PackStart (button, true, true, 0); button.GrabDefault (); ToggleButton toggle_button = new ToggleButton ("Toggle Label"); toggle_button.Clicked += new EventHandler (Label_Toggle); window.ActionArea.PackStart (toggle_button, true, true, 0); toggle_button = new ToggleButton ("Toggle Separator"); toggle_button.Clicked += new EventHandler (Separator_Toggle); window.ActionArea.PackStart (toggle_button, true, true, 0); window.ShowAll (); return window; }
private static void UpdateDialog (string format, params object[] args) { string text = String.Format (format, args); if (dialog == null) { dialog = new Dialog (); dialog.Title = "Loading data from assemblies..."; dialog.AddButton (Stock.Cancel, 1); dialog.Response += new ResponseHandler (ResponseCB); dialog.SetDefaultSize (480, 100); Box vbox = dialog.ContentArea; HBox hbox = new HBox (false, 4); vbox.PackStart (hbox, true, true, 0); Gtk.Image icon = new Gtk.Image (Stock.DialogInfo, IconSize.Dialog); hbox.PackStart (icon, false, false, 0); dialog_label = new Label (text); hbox.PackStart (dialog_label, false, false, 0); dialog.ShowAll (); } else { dialog_label.Text = text; while (Application.EventsPending ()) Application.RunIteration (); } }
void HandleViewFullExif (object sender, EventArgs args) { if (info_display_window != null) { info_display_window.Present (); return; } info_display = new FSpot.InfoDisplay (); info_display_window = new Gtk.Dialog (Catalog.GetString ("Metadata Browser"), main_window, Gtk.DialogFlags.NoSeparator | Gtk.DialogFlags.DestroyWithParent); info_display_window.SetDefaultSize (400, 400); Gtk.ScrolledWindow scroll = new ScrolledWindow (); info_display_window.VBox.PackStart (scroll); scroll.Add (info_display); info_display.Photo = CurrentPhoto; info_display_window.ShowAll (); info_display_window.Destroyed += HandleInfoDisplayDestroy; }
static void Display_Result (Gdk.Color color) { dialog = new Dialog (); dialog.Title = "Selected Color: " + HexFormat (color); dialog.HasSeparator = true; DrawingArea da = new DrawingArea (); da.ModifyBg (StateType.Normal, color); dialog.VBox.BorderWidth = 10; dialog.VBox.PackStart (da, true, true, 10); dialog.SetDefaultSize (200, 200); Button button = new Button (Stock.Ok); button.Clicked += new EventHandler (Dialog_Ok); button.CanDefault = true; dialog.ActionArea.PackStart (button, true, true, 0); button.GrabDefault (); dialog.ShowAll (); }
public void RunManager() { if (master == null) return; Widget container = ConstructUI (); if (container == null) return; Widget parent = master.Controller; if (parent != null) parent = parent.Toplevel; Dialog dialog = new Dialog (); dialog.Title = "Layout management"; dialog.TransientFor = parent as Window; dialog.AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close); dialog.SetDefaultSize (-1, 300); dialog.VBox.Add (container); dialog.Run (); dialog.Destroy (); }
static void Display_Result (Gdk.RGBA color) { dialog = new Dialog (); dialog.Title = "Selected Color: " + HexFormat (color); DrawingArea da = new DrawingArea (); da.OverrideBackgroundColor (StateFlags.Normal, color); dialog.ContentArea.BorderWidth = 10; dialog.ContentArea.PackStart (da, true, true, 10); dialog.SetDefaultSize (200, 200); Button button = new Button (Stock.Ok); button.Clicked += new EventHandler (Dialog_Ok); button.CanDefault = true; dialog.ActionArea.PackStart (button, true, true, 0); button.GrabDefault (); dialog.ShowAll (); }
public void CreateGui() { dialog = new Dialog (); dialog.AllowGrow = true; dialog.Title = "Login"; dialog.BorderWidth = 2; dialog.VBox.BorderWidth = 2; dialog.HasSeparator = false; Frame frame = new Frame ("Connection"); frame.BorderWidth = 2; Table table = new Table (7, 2, false); table.ColumnSpacing = 2; table.RowSpacing = 2; Label label = null; label = new Label ("_Provider"); label.Xalign = 1.0f; label.Ypad = 8; table.Attach (label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 1, 1); LoadProviderCombo(); if (providerCombo.Model.IterNChildren() > 0) providerCombo.Active = 0; providerSelected = providerCombo.Active; table.Attach (providerCombo, 1, 8, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 10, 1); label = new Label ("_Connection String"); label.Xpad = 2; label.Ypad = 8; label.Xalign = 1.0f; table.Attach (label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 1, 1); connection_entry = new Entry (); connection_entry.Changed += new EventHandler (OnConnectionEntryChanged); table.Attach (connection_entry, 1, 8, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 10, 1); label = new Label ("_Server"); label.Xalign = 1.0f; label.Ypad = 8; table.Attach (label, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 1, 1); server_entry = new Entry (); server_entry.Changed += new EventHandler (OnParameterChanged); table.Attach (server_entry, 1, 8, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 10, 1); label = new Label ("_Database"); label.Xalign = 1.0f; label.Ypad = 8; table.Attach (label, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 1, 1); database_entry = new Entry (); database_entry.Changed += new EventHandler (OnParameterChanged); table.Attach (database_entry, 1, 8, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 10, 1); label = new Label ("_User ID"); label.Xalign = 1.0f; label.Ypad = 8; table.Attach (label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 1, 1); userid_entry = new Entry (); userid_entry.Changed += new EventHandler (OnParameterChanged); table.Attach (userid_entry, 1, 8, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 10, 1); label = new Label ("_Password"); label.Xalign = 1.0f; label.Ypad = 8; table.Attach (label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 1, 1); password_entry = new Entry (); password_entry.Visibility = false; password_entry.Changed += new EventHandler (OnParameterChanged); table.Attach (password_entry, 1, 8, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 10, 1); label = new Label ("_Other"); label.Xalign = 1.0f; label.Ypad = 8; table.Attach (label, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Fill, 1, 1); other_entry = new Entry (); other_entry.Changed += new EventHandler (OnParameterChanged); table.Attach (other_entry, 1, 8, 6, 7, AttachOptions.Fill, AttachOptions.Fill, 10, 1); table.Show(); frame.Add (table); dialog.VBox.PackStart (frame, false, false, 5); Frame appSettingFrame = new Frame ("App Settings"); appSettingFrame.Add (grid); dialog.VBox.PackStart (appSettingFrame, true, true, 10); Button button = null; button = new Button (Stock.Ok); button.Clicked += new EventHandler (Connect_Action); button.CanDefault = true; dialog.ActionArea.PackStart (button, true, true, 0); button.GrabDefault (); button = new Button (Stock.Cancel); button.Clicked += new EventHandler (Dialog_Cancel); dialog.ActionArea.PackStart (button, true, true, 0); dialog.Modal = true; dialog.SetDefaultSize (500, 500); statusBar = new Statusbar (); statusBar.HasResizeGrip = false; dialog.VBox.PackEnd (statusBar, false, false, 0); SetStatusBarText ("Ready!"); dialog.ShowAll (); }