private Plug AttachChildViaPlug(uint socket, Gtk.Widget child)
        {
            System.Diagnostics.Trace.WriteLine("Attaching plug to socket " + socket);
            Plug plug = new Plug(socket);

            //if our plugs are unrealised and reattached too quickly, parent may not have removed the child yet
            if (child.Parent != null)
            {
                ((Container)child.Parent).Remove(child);
            }
            plug.Add(child);

            plug.Unrealized += RemovePlugChildWhenUnrealised;
            plug.Show();
            return(plug);
        }
Пример #2
0
        // Methods
        // Methods :: Public
        // Methods :: Public :: Init
        public void Init()
        {
            icon = new NotificationArea(string_program);

            icon.DestroyEvent += OnDestroyEvent;

            ebox = new EventBox();
            ebox.ButtonPressEvent += OnButtonPressEvent;

            image = new Gtk.Image();

            ebox.Add(image);
            icon.Add(ebox);

            UpdateImage();
            UpdateTooltip();

            icon.ShowAll();
        }
Пример #3
0
    public static void Main(string[] args)
    {
        if (args.Length != 2) {
        Console.WriteLine("Need socket id and file-name as an argument.");
        return;
        }
        uint socket_id = UInt32.Parse(args[0]);
        string filename=args[1];
        Console.WriteLine("filename="+filename);

        Console.WriteLine("using socket "+socket_id);

        //	    Glib.Thread.Init();
        Gdk.Threads.Init();

        Application.Init();
        Gdk.Threads.Enter();
        try {

        Plug plug= new Plug(socket_id);

        Fixed fixed1 = new Fixed();
        fixed1.Put(new Label("File: \""+filename+"\""), 10, 10);
        fixed1.Put(new Entry("HELLO"), 10, 50);
        fixed1.Put(new Entry("World"), 10, 100);
        fixed1.ShowAll();
        plug.Add(fixed1);
        plug.ShowAll();

        Console.WriteLine("app is running..");
        Application.Run();
            } finally {
          Gdk.Threads.Leave();
            }
        Console.WriteLine("Done!");
    }