本文整理汇总了C#中Gtk.Dialog类的典型用法代码示例。如果您正苦于以下问题:C# Dialog类的具体用法?C# Dialog怎么用?C# Dialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Dialog类属于Gtk命名空间,在下文中一共展示了Dialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnAddPls
public void OnAddPls()
{
Hyena.Log.Information ("add playlist");
Gtk.Dialog dlg=new Gtk.Dialog();
dlg.Title="Add Playlist";
Gtk.Entry pls=new Gtk.Entry();
pls.WidthChars=40;
Gtk.Label lbl=new Gtk.Label("Playlist name:");
Gtk.HBox hb=new Gtk.HBox();
hb.PackStart (lbl,false,false,1);
hb.PackEnd (pls);
dlg.VBox.PackStart (hb);
dlg.AddButton (Gtk.Stock.Cancel,0);
dlg.AddButton (Gtk.Stock.Ok,1);
dlg.VBox.ShowAll ();
string plsname="";
while (plsname=="") {
int response=dlg.Run ();
if (response==0) {
dlg.Hide ();
dlg.Destroy ();
return;
} else {
plsname=pls.Text.Trim ();
}
}
dlg.Hide ();
dlg.Destroy ();
_pls=_col.NewPlayList(plsname);
_model.Reload ();
_pls_model.SetPlayList (_pls);
}
示例2: BookEditor
public BookEditor()
{
Glade.XML gxml = new Glade.XML (Util.GladePath("contact-browser.glade"),
"BookEditor", null);
gxml.Autoconnect (this);
beDlg = (Gtk.Dialog) gxml.GetWidget("BookEditor");
}
示例3: 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;
}
示例4: Main
public static void Main(string[] args)
{
Application.Init ();
try {
InfoManager.Init ();
} catch (Exception e) {
Dialog d = new Dialog ("Error", null, DialogFlags.Modal, new object [] {
"OK", ResponseType.Ok });
d.VBox.Add (new Label ("There was a problem while trying to initialize the InfoManager\n\n" + e.ToString ()));
d.VBox.ShowAll ();
d.Run ();
return;
}
string profile_path = null;
if (args.Length != 0 && args[0].StartsWith ("--profile-path="))
profile_path = args[0].Substring (15);
MainWindow win = new MainWindow (profile_path);
win.Show ();
if (args.Length == 2 && File.Exists (args [0]) && File.Exists (args [1])){
win.ComparePaths (args [0], args [1]);
}
Application.Run ();
}
示例5: 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;
}
示例6: Init
/* Protected members */
protected void Init (Gtk.Dialog dialog) {
this.dialog = dialog;
Util.SetBaseWindowFromUi(dialog);
dialog.Response += OnResponse;
dialog.DeleteEvent += OnDeleteEvent;
}
示例7: EditPlayer
public override void EditPlayer(Text text)
{
playerText = text;
if (playerDialog == null) {
Gtk.Dialog d = new Gtk.Dialog (Catalog.GetString ("Select player"),
this, DialogFlags.Modal | DialogFlags.DestroyWithParent,
Stock.Cancel, ResponseType.Cancel);
d.WidthRequest = 600;
d.HeightRequest = 400;
DrawingArea da = new DrawingArea ();
TeamTagger tagger = new TeamTagger (new WidgetWrapper (da));
tagger.ShowSubstitutionButtons = false;
tagger.LoadTeams ((ViewModel.Project as ProjectLongoMatch).LocalTeamTemplate, (ViewModel.Project as ProjectLongoMatch).VisitorTeamTemplate,
(ViewModel.Project as ProjectLongoMatch).Dashboard.FieldBackground);
tagger.PlayersSelectionChangedEvent += players => {
if (players.Count == 1) {
Player p = players [0];
playerText.Value = p.ToString ();
d.Respond (ResponseType.Ok);
}
tagger.ResetSelection ();
};
d.VBox.PackStart (da, true, true, 0);
d.ShowAll ();
playerDialog = d;
}
if (playerDialog.Run () != (int)ResponseType.Ok) {
text.Value = null;
}
playerDialog.Hide ();
}
示例8: onClick
private void onClick(object Sender, EventArgs e)
{
Dialog d = new Dialog ("Test", this, DialogFlags.DestroyWithParent);
d.Modal = true;
d.AddButton ("Close", ResponseType.Close);
d.Run ();
d.Destroy ();
}
示例9: PreferencesDialog
public PreferencesDialog(Settings set, Window parent,
string argsOver)
{
settings = set;
argsOverride = argsOver;
dialog = new Dialog("Preferences", parent,
DialogFlags.Modal | DialogFlags.DestroyWithParent,
new object[]{Gtk.Stock.Close, -1});
var table = new Table(4, 3, false);
sUseBundledDebugger = new CheckButton("Use bundled MSPDebug");
sUseBundledDebugger.Clicked += OnBundledState;
table.Attach(sUseBundledDebugger, 0, 3, 0, 1,
AttachOptions.Expand | AttachOptions.Fill,
0, 4, 4);
Label lbl;
lbl = new Label("MSPDebug path:");
lbl.SetAlignment(0.0f, 0.5f);
table.Attach(lbl, 0, 1, 1, 2, AttachOptions.Fill, 0, 4, 4);
sMSPDebugPath = new Entry();
table.Attach(sMSPDebugPath, 1, 2, 1, 2,
AttachOptions.Expand | AttachOptions.Fill,
0, 4, 4);
chooseMSPDebug = new Button("Choose...");
chooseMSPDebug.Clicked += OnChoose;
table.Attach(chooseMSPDebug, 2, 3, 1, 2,
AttachOptions.Fill, 0, 4, 4);
lbl = new Label("MSPDebug arguments:");
lbl.SetAlignment(0.0f, 0.5f);
table.Attach(lbl, 0, 1, 2, 3, AttachOptions.Fill, 0, 4, 4);
sMSPDebugArgs = new Entry();
sMSPDebugArgs.Sensitive = (argsOverride == null);
table.Attach(sMSPDebugArgs, 1, 3, 2, 3,
AttachOptions.Expand | AttachOptions.Fill,
0, 4, 4);
lbl = new Label("Console font:");
lbl.SetAlignment(0.0f, 0.5f);
table.Attach(lbl, 0, 1, 3, 4, AttachOptions.Fill, 0, 4, 4);
sConsoleFont = new FontButton();
table.Attach(sConsoleFont, 1, 3, 3, 4,
AttachOptions.Expand | AttachOptions.Fill,
0, 4, 4);
table.ShowAll();
((Container)dialog.Child).Add(table);
chooseDialog = new FileChooserDialog("Choose MSPDebug binary",
dialog, FileChooserAction.Open,
new object[]{Stock.Cancel, ResponseType.Cancel,
Stock.Ok, ResponseType.Ok});
chooseDialog.DefaultResponse = ResponseType.Ok;
}
示例10: Dispose
public void Dispose ()
{
if (GotoLineDialog != null) {
GotoLineDialog.Dispose ();
GotoLineDialog = null;
line_number_entry = null;
IsVisible = false;
}
}
示例11: ErrorDialog
static ErrorDialog()
{
XML gxml = new Glade.XML (null,
WorkbenchSingleton.GLADEFILE,
"ErrorDialog",
null);
dialog = (Dialog) gxml["ErrorDialog"];
Gtk.TextView errorTextView = (TextView) gxml["errorTextView"];
errorBuffer = errorTextView.Buffer;
}
示例12: Initialize
void Initialize(Window parent)
{
Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("LadderLogic.Presentation.OpenFileDialog.glade");
Glade.XML glade = new Glade.XML(stream, "OpenFileDialog", null);
stream.Close();
glade.Autoconnect(this);
thisDialog = ((Gtk.Dialog)(glade.GetWidget("OpenFileDialog")));
thisDialog.Modal = true;
thisDialog.TransientFor = parent;
thisDialog.SetPosition (WindowPosition.Center);
}
示例13: GladeDialog
public GladeDialog(string name)
: base(name)
{
dialog = base.Window as Dialog;
if (dialog != null) {
dialog.Response += delegate (object o, ResponseArgs args) {
OnResponse (args.ResponseId);
};
}
}
示例14: ImportDialog
static ImportDialog()
{
gxml = new Glade.XML (null,
WorkbenchSingleton.GLADEFILE,
"ImportDialog",
null);
importDialog = (Dialog) gxml["ImportDialog"];
typeCombo = (Combo) gxml["typeCombo"];
formatCombo = (Combo) gxml["formatCombo"];
okButton = (Button) gxml["okButton"];
}
示例15: RunDialog
private bool RunDialog (Dialog dlg)
{
bool result = false;
try {
if (dlg.Run () == (int)ResponseType.Ok)
result = true;
} finally {
dlg.Destroy ();
}
return result;