当前位置: 首页>>代码示例>>C#>>正文


C# Gtk.Window类代码示例

本文整理汇总了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);
		}
开发者ID:m13253,项目名称:xwt,代码行数:32,代码来源:GtkIntegrationTests.cs

示例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;
        }
开发者ID:RoninBG,项目名称:smuxi,代码行数:28,代码来源:ServerListView.cs

示例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, "");
 }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:7,代码来源:CommandManager.cs

示例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);
        }
开发者ID:pupitetris,项目名称:imr,代码行数:30,代码来源:AddressEditor.cs

示例5: ProgressBarWindow

 public ProgressBarWindow(Gtk.Window parent)
     : base(Gtk.WindowType.Toplevel)
 {
     _mainWin = parent;
     this.Build ();
     this.Shown += delegate { Dialogs.CenterChildToParent(parent,this); };
 }
开发者ID:petrj,项目名称:MP3Tagger,代码行数:7,代码来源:ProgressBarWindow.cs

示例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();
        }
开发者ID:GTWebSoftware,项目名称:OpenGeckoSharp,代码行数:28,代码来源:Test.cs

示例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);
            }
        }
开发者ID:mono,项目名称:stetic,代码行数:32,代码来源:FlagsSelectorDialog.cs

示例8: Dispose

 public override void Dispose()
 {
     base.Dispose();
     if(this.Window != null)
     {
         this.Window.Destroy();
         this.Window = null;
     }
 }
开发者ID:langpavel,项目名称:LPS-old,代码行数:9,代码来源:WindowContext.cs

示例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);
     });
 }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:9,代码来源:WindowOpacityFader.cs

示例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 ();
 }
开发者ID:carlosalberto,项目名称:xwt,代码行数:10,代码来源:WindowBackend.cs

示例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;
        }
开发者ID:kelsieflynn,项目名称:banshee,代码行数:10,代码来源:PersistentWindowController.cs

示例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;
 }
开发者ID:monsterlabs,项目名称:HumanRightsTracker,代码行数:12,代码来源:DateSelectorWindow.cs

示例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);
        }
开发者ID:pupitetris,项目名称:imr,代码行数:12,代码来源:PhoneEditor.cs

示例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 ();
        }
开发者ID:jassmith,项目名称:ColorMaker,代码行数:13,代码来源:Main.cs

示例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;
        }
开发者ID:mauroguardarini,项目名称:sugar-sharp,代码行数:13,代码来源:Activity.cs


注:本文中的Gtk.Window类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。