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


C# Button.SetSizeRequest方法代码示例

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


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

示例1: SharpApp

    public SharpApp()
        : base("Center")
    {
        SetDefaultSize(250, 200);
        SetPosition(WindowPosition.Center);

        DeleteEvent += delegate { Application.Quit(); };

        Fixed fix = new Fixed();

        Button btn1 = new Button("Button");
        btn1.Sensitive = false;
        Button btn2 = new Button("Button");
        Button btn3 = new Button(Stock.Close);
        Button btn4 = new Button("Button");
        btn4.SetSizeRequest(80,40);

        fix.Put(btn1,	20,	30);
        fix.Put(btn2,	100, 	30);
        fix.Put(btn3,	20,	80);
        fix.Put(btn4,	100,	80);

        Add(fix);

        ShowAll();
    }
开发者ID:Jimmyscene,项目名称:Random,代码行数:26,代码来源:center.cs

示例2: GUIMainAdmin

    public GUIMainAdmin()
    {
        UserAdministration = new Button();
        UserAdministration.SetSizeRequest(296, 33);
        UserAdministration.Name = "UserAdministration";
        UserAdministration.Label = "Otwórz okno administracji użytkownikami";
        base.addWidget(UserAdministration, 342, 53);

        setEvents();
    }
开发者ID:shark555,项目名称:Resources-Reservation-System,代码行数:10,代码来源:GUIMainAdmin.cs

示例3: GUIMainWykladowca

    public GUIMainWykladowca()
    {
        ShowTopics = new Button();
        ShowTopics.SetSizeRequest(296, 33);
        ShowTopics.Name = "ShowTopics";
        ShowTopics.Label = "Pokaż tematy oczekujące akceptacji";
        base.addWidget(ShowTopics, 342, 53);

        setEvents();
    }
开发者ID:shark555,项目名称:Resources-Reservation-System,代码行数:10,代码来源:GUIMainWykladowca.cs

示例4: SharpApp

    public SharpApp()
        : base("Windows")
    {
        SetDefaultSize(300,250);
        SetPosition(WindowPosition.Center);
        BorderWidth=15;
        DeleteEvent += delegate{Application.Quit();};

        Table table = new Table(8, 4, false);

        table.ColumnSpacing = 3;

        Label title = new Label("Windows");

        Alignment halign = new Alignment(0,0,0,0);

        halign.Add(title);

        table.Attach(halign, 0,1,0,1, AttachOptions.Fill, AttachOptions.Fill, 0,0);

        TextView wins = new TextView();

        wins.ModifyFg(StateType.Normal, new Gdk.Color(20,20,20));
        wins.CursorVisible = false;
        table.Attach(wins, 0,2,1,3, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 1,1);
        Button activate = new Button("Activate");
        activate.SetSizeRequest(50,30);
        table.Attach(activate,3,4,1,2,AttachOptions.Fill, AttachOptions.Shrink,1,1);
        Alignment valign = new Alignment(0,0,0,0);
        Button close = new Button("Close");
        close.SetSizeRequest(70,30);
        valign.Add(close);
        table.SetRowSpacing(1,3);
        table.Attach(valign,3,4,2,3,AttachOptions.Fill, AttachOptions.Fill | AttachOptions.Expand,1,1);

        Alignment halign2 =  new Alignment(0,1,0,0);
        Button help = new Button("Help");
        help.SetSizeRequest(70,30);
        halign2.Add(help);
        table.SetRowSpacing(3,6);
        table.Attach(halign2, 0,1,4,5, AttachOptions.Fill, AttachOptions.Fill, 0,0);

        Button ok = new Button("Ok");
        ok.SetSizeRequest(70,30);
        table.Attach(ok,3,4,4,5,AttachOptions.Fill, AttachOptions.Fill, 0,0);

        Add(table);
        ShowAll();
    }
开发者ID:Jimmyscene,项目名称:Random,代码行数:49,代码来源:windows.cs

示例5: TabLabel

        public TabLabel(string label)
            : base(false, 2)
        {
            title = new Label (label);

            this.PackStart (title, true, true, 0);

            btn = new Button ();
            btn.Add (new Gtk.Image (Stock.Close, IconSize.Menu));
            btn.Relief = ReliefStyle.None;
            btn.SetSizeRequest (18, 18);
            this.PackStart (btn, false, false, 2);
            this.ClearFlag (WidgetFlags.CanFocus);

            this.ShowAll ();
        }
开发者ID:mono,项目名称:heap-prof,代码行数:16,代码来源:ShellPager.cs

示例6: MainWindow

    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        m_scrapeViewModel = new ScrapeViewModel();

        VBox vbox = new VBox();
        {
            HBox hbox = new HBox();
            {
                m_urlEntry = new Entry("http://www.google.com");
                {
                    m_urlEntry.Changed += OnUrlEntryChanged;

                    hbox.PackStart(m_urlEntry, true, true, 4);
                }

                m_startButton = new Button(c_startButtonText);
                {
                    m_startButton.SetSizeRequest(60, 16);
                    m_startButton.TooltipText = "Start crawling the site.";

                    m_startButton.Clicked += OnStartButtonClicked;

                    hbox.PackEnd(m_startButton, false, true, 4);
                }

                vbox.PackStart(hbox, false, true, 8);
            }

            Notebook notebook = new Notebook();
            {
                ScrolledWindow scrolledWindow = new ScrolledWindow();
                {
                    TreeView treeview = new TreeView();
                    {
                        treeview.SetSizeRequest(200, 200);
                        treeview.HeadersVisible = false;

                        TreeViewColumn colOne = new TreeViewColumn();
                        {
                            CellRendererText cellRendererText = new CellRendererText();
                            {
                                colOne.PackStart(cellRendererText, true);
                                colOne.AddAttribute(cellRendererText, "text", 0);
                            }

                            treeview.AppendColumn(colOne);
                        }

                        treeview.Model = m_scrapeViewModel.ExploredLinks;

                        scrolledWindow.Add(treeview);
                    }

                    notebook.AppendPage(scrolledWindow, new Label("Explored Link"));
                }

                vbox.Add(notebook);
            }

            this.Add(vbox);
        }

        this.DeleteEvent += OnDeleteEvent;

        this.ShowAll();
    }
开发者ID:CalebMorris,项目名称:siteScraper,代码行数:67,代码来源:MainWindow.cs

示例7: DialBOT

    // This requires that the perl program autorestart wraps this....
    public DialBOT()
        : base("DialBOT")
    {
        SetDefaultSize(800, 600);
        SetPosition(WindowPosition.Center);
        DeleteEvent += delegate { Application.Quit(); };

        // Top level container. This vertically divides the window into 3 sections:
        // Top is the 2 windows (balls-deep items and console output
        VBox topvbox = new VBox(false, 5);

        // Lets build the top 1/3rd here.
        Frame ballsdeepframe = new Frame("Balls-Deep Items");
        Frame consoleframe = new Frame("Console Output");
        // HBox mainhbox = new HBox(true,2);

        ballsdeeptree = new TreeView();

        bdstore = new TreeStore (typeof(string), typeof (string), typeof (string), typeof (string));
        LoadBalls();
        fillStore();

        // Put the TreeStore into a TreeModelSort so we can sort columns...
        // Sort by score for now
        bdsorted = new TreeModelSort(bdstore);
        bdsorted.SetSortColumnId(1,SortType.Descending);

        // Put the TreeModelSort into a TreeModelFilter so we can implement the filtering
        filterEntry = new Entry();
        // filter = new TreeModelFilter(bdsorted,null);
        // filter.VisibleFunc = FilterTreeFunc;   // Use this as the filter function.

        // And then set the visible TreeView to use the filter as it's store.
        ballsdeeptree.Model = bdsorted;

        ballsdeeptree.HeadersVisible = true;
        ballsdeeptree.HeadersClickable=true;
        ballsdeeptree.AppendColumn ("Added By", new CellRendererText (), "text", 0);
        ballsdeeptree.AppendColumn ("Score", new CellRendererText (), "text", 1);
        CellRendererText ballRenderer = new CellRendererText();
        ballsdeeptree.AppendColumn ("Text", ballRenderer, "text", 2);
        CellRendererText voteRenderer = new CellRendererText();
        voteRenderer.Editable=true;
        voteRenderer.Edited+=editVotes;
        ballsdeeptree.AppendColumn ("Votes", voteRenderer, "text", 3);

        TreeViewColumn col = ballsdeeptree.GetColumn(0);
        col.Clickable=true;
        col.Resizable = true;
        col.Clicked += new EventHandler (col_clicked0);

        col = ballsdeeptree.GetColumn(1);
        col.Resizable = true;
        col.Clickable=true;
        col.Clicked += new EventHandler (col_clicked1);

        col = ballsdeeptree.GetColumn(2);
        col.Resizable = true;
        col.Clickable=true;
        col.Clicked += new EventHandler (col_clicked2);

        col = ballsdeeptree.GetColumn(3);
        col.Clickable=true;
        col.Resizable = true;
        col.Clicked += new EventHandler (col_clicked3);

        ScrolledWindow ballsdeepscroll = new ScrolledWindow();

        ballsdeepscroll.Add(ballsdeeptree);

        Button deleteentry = new Button("Remove Entry");
        deleteentry.SetSizeRequest(70, 30);
        deleteentry.Clicked += new EventHandler(deleteBallMsg);

        ballsdeepframe.Add(ballsdeepscroll);
        ballsdeepframe.Add(deleteentry);

        // Entry box and label to filter on message as well as an HBox to put them next to each other
        filterEntry.Changed += OnFilterEntryTextChanged;
        Label filterLabel = new Label("Ball Message Search: ");
        HBox filterBox = new HBox();
        filterBox.PackStart(filterLabel,false,false,5);
        filterBox.PackStart(filterEntry,true,true,5);

        VBox ballvbox = new VBox(false,5);
        ballvbox.Add(ballsdeepframe);
        //ballvbox.PackStart(filterBox,false,false,1);

        topvbox.Add(ballvbox);

        consoleview = new TextView();
        consolebuffer=consoleview.Buffer;
        consolebuffer.Text = consoletext;

        ScrolledWindow consolescroll = new ScrolledWindow();
        consolescroll.SetPolicy(PolicyType.Automatic,PolicyType.Always);
        consolescroll.Add(consoleview);

        consoleframe.Add(consolescroll);
//.........这里部分代码省略.........
开发者ID:dialmaster,项目名称:DIALBOT,代码行数:101,代码来源:dialbotgui-6-1.cs


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