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


C# Window.Present方法代码示例

本文整理汇总了C#中Gtk.Window.Present方法的典型用法代码示例。如果您正苦于以下问题:C# Window.Present方法的具体用法?C# Window.Present怎么用?C# Window.Present使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk.Window的用法示例。


在下文中一共展示了Window.Present方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: on_button_take_photo_clicked

    void on_button_take_photo_clicked(object o, EventArgs args)
    {
        List<LongoMatch.Video.Utils.Device> devices = LongoMatch.Video.Utils.Device.ListVideoDevices();
        if(devices.Count == 0) {
            new DialogMessage(Constants.MessageTypes.WARNING, Constants.CameraNotFound);
            return;
        }

        //deactivate camera to allow camera on edit person. videoOn will have same value to light checkbutton again later
        app1_checkbutton_video.Active = false;

        capturer = new CapturerBin();
        CapturePropertiesStruct s = new CapturePropertiesStruct();

        s.DeviceID = devices[0].ID;

        s.CaptureSourceType = CaptureSourceType.System;

        capturer.CaptureProperties = s;
        capturer.Type = CapturerType.Snapshot;
        capturer.Visible=true;
        capturer.NewSnapshot += on_snapshot_done;
        capturer.NewSnapshotMini += on_snapshot_mini_done;

        capturerWindow = new Gtk.Window("Capturer");
        capturerWindow.Add(capturer);
        capturerWindow.Modal=true;
        capturerWindow.SetDefaultSize(400,400);

        person_win.Hide();

        capturerWindow.ShowAll();
        capturerWindow.Present();
        capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose(); person_win.Show(); };

        capturer.Run();
    }
开发者ID:GNOME,项目名称:chronojump,代码行数:37,代码来源:person.cs

示例2: ThrowMessage

        ////////////////////////////////////////////////////////////////////
        ///<summary>
        ///ThrowMessage receives a msg and show a window. 
        ///Is intended to show exception messages
        ///</summary>
        // FIXME: Draw a better interface with l10n messages
        public static void ThrowMessage(string Msg, string short_msg)
        {
            Gtk.Window msgwindow = new Gtk.Window("Exception");
                Gtk.VBox box = new Gtk.VBox(false, 0);
                Gtk.ScrolledWindow scrWin = new Gtk.ScrolledWindow();
                Gtk.TextView txtView = new Gtk.TextView();
                Gtk.TextBuffer buffer = txtView.Buffer;
                buffer.Text = "Critical exception: " + short_msg;
                buffer.Text += "\r\n \r\nReport for developers : " + Msg;
                Gtk.Button buttonAccept = new Button("Accept");
                Gtk.Button buttonExit = new Button("Exit");

                msgwindow.DeleteEvent += new DeleteEventHandler(OnDelete);
                buttonExit.Clicked += new EventHandler(OnDelete);
                msgwindow.DestroyEvent += new DestroyEventHandler(OnContinue);
                buttonAccept.Clicked += new EventHandler(OnContinue);
                msgwindow.Add(scrWin);
                scrWin.Add(txtView);
                box.Spacing = 20;
                box.PackStart(scrWin);
                box.PackStart(buttonExit);
                box.PackStart(buttonAccept);
                //txtView.Show();
                //buttonExit.Show();
                //box.Show();
                msgwindow.DefaultHeight = 300;
                msgwindow.DefaultWidth  = 600;
                msgwindow.SetPosition(WindowPosition.Center);
                msgwindow.ShowAll();
                msgwindow.Present();
        }
开发者ID:BackupTheBerlios,项目名称:boxerp-svn,代码行数:37,代码来源:ClientExceptions.cs

示例3: on_button_take_photo_clicked

    void on_button_take_photo_clicked(object o, EventArgs args)
    {
        capturer = new CapturerBin();
        CapturePropertiesStruct s = new CapturePropertiesStruct();

        s.CaptureSourceType = CaptureSourceType.Raw;

        capturer.CaptureProperties = s;
        capturer.Type = CapturerType.Snapshot;
        capturer.Visible=true;
        capturer.NewSnapshot += on_snapshot_done;
        capturer.NewSnapshotMini += on_snapshot_mini_done;

         		capturerWindow = new Gtk.Window("Capturer");
        capturerWindow.Add(capturer);
        capturerWindow.Modal=true;

        person_win.Hide();

        capturerWindow.ShowAll();
        capturerWindow.Present();
        capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose(); person_win.Show(); };
        capturer.Run();
    }
开发者ID:dineshkummarc,项目名称:chronojump,代码行数:24,代码来源:person.cs

示例4: ClientErrorMessages

 public ClientErrorMessages(string Msg)
 {
     try
     {
         msgwindow    = new Gtk.Window("Error");
         vbox         = new Gtk.VBox(false, 0);
         hbox         = new Gtk.HBox(true, 1);
         label			   = new Gtk.Label(Msg);
         buttonAccept = new Button("Aceptar");
         msgwindow.DeleteEvent += new DeleteEventHandler(OnDelete);
         msgwindow.DestroyEvent += new DestroyEventHandler(OnContinue);
         buttonAccept.Clicked += new EventHandler(OnContinue);
         msgwindow.Modal = true;
         msgwindow.Add(vbox);
         vbox.Spacing = 20;
         vbox.PackStart(label, false, false, 10);
         vbox.PackEnd(hbox, false, false, 10);
         hbox.PackEnd(buttonAccept, false, false, 10);
         //msgwindow.DefaultHeight = 150;
         //msgwindow.DefaultWidth  = 400;
         msgwindow.SetPosition(WindowPosition.Center);
         msgwindow.ShowAll();
         msgwindow.Present();
     }
     catch (Exception ex)
     {
         Console.WriteLine("Excepcion grave");
     }
 }
开发者ID:BackupTheBerlios,项目名称:boxerp-svn,代码行数:29,代码来源:ClientExceptions.cs


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