本文整理汇总了C#中Gtk.Window类的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Window类的具体用法?C# Gtk.Window怎么用?C# Gtk.Window使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gtk.Window类属于命名空间,在下文中一共展示了Gtk.Window类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NativeWindowFrameHasCorrectScreenBounds
public void NativeWindowFrameHasCorrectScreenBounds ()
{
var nativeWindow = new Gtk.Window ("Foo");
nativeWindow.Resize (450, 320);
nativeWindow.Move (13, 50);
nativeWindow.ShowAll ();
WaitForEvents ();
var window = Toolkit.CurrentEngine.WrapWindow (nativeWindow);
var bounds = window.ScreenBounds;
Assert.AreEqual (450, bounds.Width);
Assert.AreEqual (320, bounds.Height);
Assert.AreEqual (13, bounds.X);
Assert.AreEqual (50, bounds.Y);
nativeWindow.Move (30, 100);
WaitForEvents ();
bounds = window.ScreenBounds;
Assert.AreEqual (30, bounds.X);
Assert.AreEqual (100, bounds.Y);
Assert.AreEqual (450, bounds.Width);
Assert.AreEqual (320, bounds.Height);
nativeWindow.Resize (100, 100);
WaitForEvents ();
bounds = window.ScreenBounds;
Assert.AreEqual (30, bounds.X);
Assert.AreEqual (100, bounds.Y);
Assert.AreEqual (100, bounds.Width);
Assert.AreEqual (100, bounds.Height);
}
示例2: ServerListView
public ServerListView(Gtk.Window parent, Glade.XML gladeXml)
{
Trace.Call(parent, gladeXml);
if (parent == null) {
throw new ArgumentNullException("parent");
}
_Parent = parent;
_Controller = new ServerListController(Frontend.UserConfig);
gladeXml.BindFields(this);
_AddButton.Clicked += new EventHandler(OnAddButtonClicked);
_EditButton.Clicked += new EventHandler(OnEditButtonClicked);
_RemoveButton.Clicked += new EventHandler(OnRemoveButtonClicked);
_TreeView.AppendColumn(_("Protocol"), new Gtk.CellRendererText(), "text", 1);
_TreeView.AppendColumn(_("Hostname"), new Gtk.CellRendererText(), "text", 2);
_TreeStore = new Gtk.TreeStore(typeof(ServerModel),
typeof(string), // protocol
typeof(string) // hostname
);
_TreeView.RowActivated += OnTreeViewRowActivated;
_TreeView.Selection.Changed += OnTreeViewSelectionChanged;
_TreeView.Model = _TreeStore;
}
示例3: CommandManager
public CommandManager(Gtk.Window root)
{
rootWidget = root;
ActionCommand c = new ActionCommand (CommandSystemCommands.ToolbarList, "Toolbar List", null, null, ActionType.Check);
c.CommandArray = true;
RegisterCommand (c, "");
}
示例4: AddressEditor
public AddressEditor(AppConfig config, Gtk.Window parent, Gtk.Container cont, JObject data = null)
{
this.Build ();
this.config = config;
ParentWin = parent;
Cont = cont;
myComboState = new MyCombo (comboState);
myComboMuni = new MyCombo (comboMuni);
myComboAsenta = new MyCombo (comboAsenta);
buttonDelete.ConfirmClick += OnDeleteConfirm;
WidgetPath = Util.GtkGetWidgetPath (this, config);
if (GlobalDefaultStateID == -1)
config.LoadWindowKey (WidgetPath, "default_state_id", out GlobalDefaultStateID);
DefaultStateID = GlobalDefaultStateID;
if (GlobalDefaultMuniID == -1)
config.LoadWindowKey (WidgetPath, "default_muni_id", out GlobalDefaultMuniID);
DefaultMuniID = GlobalDefaultMuniID;
if (GlobalDefaultAsentaID == -1)
config.LoadWindowKey (WidgetPath, "default_asenta_id", out GlobalDefaultAsentaID);
DefaultAsentaID = GlobalDefaultAsentaID;
LoadData (data);
}
示例5: ProgressBarWindow
public ProgressBarWindow(Gtk.Window parent)
: base(Gtk.WindowType.Toplevel)
{
_mainWin = parent;
this.Build ();
this.Shown += delegate { Dialogs.CenterChildToParent(parent,this); };
}
示例6: TestReparenting_ShouldDrawALineInForm
public void TestReparenting_ShouldDrawALineInForm()
{
Gtk.Application.Init();
Form testForm = new Form();
testForm.Show();
Application.DoEvents();
var containerWindow = new Gtk.Window(Gtk.WindowType.Popup);
containerWindow.ShowNow();
containerWindow.Move(-5000, -5000);
while (Gtk.Application.EventsPending()) {
Gtk.Application.RunIteration(false);
}
var gdkWrapperOfForm = Gdk.Window.ForeignNewForDisplay(Gdk.Display.Default, (uint)testForm.Handle);
containerWindow.GdkWindow.Reparent(gdkWrapperOfForm, 0, 0);
Gdk.GC color = containerWindow.Style.DarkGC (Gtk.StateType.Normal);
containerWindow.GdkWindow.DrawLine(color, 0, 0, 100, 100);
while (Gtk.Application.EventsPending()) {
Gtk.Application.RunIteration(false);
}
Application.DoEvents();
}
示例7: FlagsSelectorDialog
public FlagsSelectorDialog(Gtk.Window parent, EnumDescriptor enumDesc, uint flags, string title)
{
this.flags = flags;
this.parent = parent;
Glade.XML xml = new Glade.XML (null, "stetic.glade", "FlagsSelectorDialog", null);
xml.Autoconnect (this);
store = new Gtk.ListStore (typeof(bool), typeof(string), typeof(uint));
treeView.Model = store;
Gtk.TreeViewColumn col = new Gtk.TreeViewColumn ();
Gtk.CellRendererToggle tog = new Gtk.CellRendererToggle ();
tog.Toggled += new Gtk.ToggledHandler (OnToggled);
col.PackStart (tog, false);
col.AddAttribute (tog, "active", 0);
Gtk.CellRendererText crt = new Gtk.CellRendererText ();
col.PackStart (crt, true);
col.AddAttribute (crt, "text", 1);
treeView.AppendColumn (col);
foreach (Enum value in enumDesc.Values) {
EnumValue eval = enumDesc[value];
if (eval.Label == "")
continue;
uint val = (uint) (int) eval.Value;
store.AppendValues (((flags & val) != 0), eval.Label, val);
}
}
示例8: Dispose
public override void Dispose()
{
base.Dispose();
if(this.Window != null)
{
this.Window.Destroy();
this.Window = null;
}
}
示例9: WindowOpacityFader
public WindowOpacityFader(Gtk.Window win, double target, double msec)
{
this.win = win;
win.Mapped += HandleMapped;
win.Unmapped += HandleUnmapped;
fadin = new DoubleAnimation (0.0, target, TimeSpan.FromMilliseconds (msec), opacity => {
CompositeUtils.SetWinOpacity (win, opacity);
});
}
示例10: WindowBackend
public WindowBackend()
{
Window = new Gtk.Window ("");
mainBox = new Gtk.VBox ();
Window.Add (mainBox);
mainBox.Show ();
alignment = new Gtk.Alignment (0, 0, 1, 1);
mainBox.PackStart (alignment, true, true, 0);
alignment.Show ();
}
示例11: PersistentWindowController
public PersistentWindowController(Gtk.Window window, WindowConfiguration windowConfig, WindowPersistOptions options)
{
this.window = window;
this.options = options;
this.window_config = windowConfig;
window.ConfigureEvent += OnChanged;
window.WindowStateEvent += OnChanged;
window.DestroyEvent += OnDestroy;
}
示例12: DateSelectorWindow
public DateSelectorWindow (int x, int y, DateTime defDate, DateEventHandler handler, Gtk.Window parent) : base(Gtk.WindowType.Popup)
{
this.TransientFor = parent;
_parent = parent;
_parent.Modal = false;
this.Modal = true;
this.Build ();
this.Move (x, y);
this.WindowPosition = Gtk.WindowPosition.None;
this.OnChange = handler;
cal.Date = defDate;
}
示例13: PhoneEditor
public PhoneEditor(AppConfig config, Gtk.Window parent, Gtk.Container cont, JObject data = null)
{
this.Build ();
this.config = config;
ParentWin = parent;
Cont = cont;
buttonDelete.ConfirmClick += OnDeleteConfirm;
LoadData (data);
}
示例14: Main
public static void Main(string[] args)
{
GLib.Thread.Init ();
Gtk.Application.Init ();
ColorMaker maker = new ColorMaker ();
Gtk.Window window = new Gtk.Window ("Test");
window.Add (maker);
window.ShowAll ();
Gtk.Application.Run ();
}
示例15: Activity
public Activity(Gtk.Window form, string activityId, string bundleId)
{
_activityId=activityId;
_bundleId=bundleId;
_wnd=form;
DBusActivity dbus=new DBusActivity(this);
if (form.IsRealized) {
System.Console.Out.WriteLine("Error, the Window is already Realized so it is possible that the form is not sugarized.");
}
_wnd.Realized += realizeEventHandler;
}