コード例 #1
0
        public PasswordEntry()
        {
            autoReset = new AutoResetEvent(false);
            Title     = Catalog.GetString("Please enter the password");
            Gtk.VBox pwbox = new Gtk.VBox(false, 6);

            pwbox.PackStart(new Gtk.Label(Catalog.GetString("Please enter the password:"******"";
            pwbox.PackStart(pw);

            pw2 = new Gtk.Entry();
            // set password style:
            pw2.InvisibleChar = '*';
            pw2.Visibility    = false;
            pw2.Text          = "";
            pwbox.PackStart(pw2);

            pw.Changed  += PasswordChanged;
            pw2.Changed += PasswordChanged;

            match_label        = new Gtk.Label();
            match_label.Markup = Catalog.GetString(AddinPreferences.MATCH_TEXT);
            pwbox.PackStart(match_label);


            Gtk.Button button = (Gtk.Button)AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok);
            button.CanDefault = true;
            //button.Show();
            pwbox.PackStart(button);
            //this.VBox.PackStart(button);

            Gtk.AccelGroup accel_group = new Gtk.AccelGroup();
            AddAccelGroup(accel_group);

            button.AddAccelerator("activate",
                                  accel_group,
                                  (uint)Gdk.Key.Escape,
                                  0,
                                  0);

            AddActionWidget(button, Gtk.ResponseType.Ok);
            DefaultResponse = Gtk.ResponseType.Ok;

            accel_group.AccelActivate += OnAction;
            Response += OnResponse;

            DeleteEvent += new Gtk.DeleteEventHandler(PasswordEntry_DeleteEvent);

            pwbox.ShowAll();
            this.VBox.PackStart(pwbox);

            // show() must happen on ui thread
            Gtk.Application.Invoke(RunInUiThread);
        }
コード例 #2
0
ファイル: navegador.cs プロジェクト: olea/LuCAS
    public Navegador()
        : base("navegador")
    {
        SetDefaultSize( 300, 300);
                DeleteEvent += new Gtk.DeleteEventHandler( Quit );

                hbox = new Gtk.HBox( false, 3 );
                Add( hbox );

                Gtk.ScrolledWindow sw1 = new Gtk.ScrolledWindow();
                Gtk.ScrolledWindow sw2 = new Gtk.ScrolledWindow();
                Gtk.ScrolledWindow sw3 = new Gtk.ScrolledWindow();

                html_enlaces = new Gtk.HTML();
                sw1.Add( html_enlaces );

                html_en = new Gtk.HTML();
                sw2.Add( html_en );

                html_es = new Gtk.HTML();
                sw3.Add( html_es );

                hbox.PackStart( sw1, true, true, 1 );
                hbox.PackStart( sw2, true, true, 1 );
                hbox.PackStart( sw3, true, true, 1 );

                s1 = html_enlaces.Begin("text/html");
                s2 = html_en.Begin("text/html");
                s3 = html_es.Begin("text/html");

                using (StreamReader sr1 = new StreamReader( "es/index.html") )
                {
                        s1.Write( sr1.ReadToEnd() );
                }
                html_enlaces.End (s1, Gtk.HTMLStreamStatus.Ok);

                html_enlaces.LinkClicked += new Gtk.LinkClickedHandler (OnLinkClicked);
                html_en.LinkClicked += new Gtk.LinkClickedHandler (OnLinkClicked);
                html_es.LinkClicked += new Gtk.LinkClickedHandler (OnLinkClicked);

                LoadURL( "1.html" );

                ShowAll();
    }
コード例 #3
0
        public DefaultWorkbench()
            : base(Gtk.WindowType.Toplevel)
        {
            Title = "MonoDevelop";
            Runtime.LoggingService.Info ("Creating DefaultWorkbench");

            windowChangeEventHandler = new EventHandler(OnActiveWindowChanged);

            WidthRequest = normalBounds.Width;
            HeightRequest = normalBounds.Height;

            DeleteEvent += new Gtk.DeleteEventHandler (OnClosing);
            this.Icon = Runtime.Gui.Resources.GetBitmap ("md-sharp-develop-icon");
            //this.WindowPosition = Gtk.WindowPosition.None;

            IDebuggingService dbgr = Runtime.DebuggingService;
            if (dbgr != null) {
                dbgr.PausedEvent += (EventHandler) Runtime.DispatchService.GuiDispatch (new EventHandler (onDebuggerPaused));
            }

            Gtk.Drag.DestSet (this, Gtk.DestDefaults.Motion | Gtk.DestDefaults.Highlight | Gtk.DestDefaults.Drop, targetEntryTypes, Gdk.DragAction.Copy);
            DragDataReceived += new Gtk.DragDataReceivedHandler (onDragDataRec);

            Runtime.Gui.CommandService.SetRootWindow (this);
        }