本文整理汇总了C#中Gtk.Dialog.SetDefaultSize方法的典型用法代码示例。如果您正苦于以下问题:C# Dialog.SetDefaultSize方法的具体用法?C# Dialog.SetDefaultSize怎么用?C# Dialog.SetDefaultSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Dialog
的用法示例。
在下文中一共展示了Dialog.SetDefaultSize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
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;
}
示例2: Create
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;
}
示例3: UpdateDialog
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 ();
}
}
示例4: HandleViewFullExif
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;
}
示例5: Display_Result
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 ();
}
示例6: RunManager
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 ();
}
示例7: Display_Result
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 ();
}
示例8: CreateGui
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);
//.........这里部分代码省略.........