ARTICLE

Gtk# window application with MonoDevelop

Posted by Deepak Dwij Articles | MonoDevelop November 24, 2011
In this application, when we put any text input into entry widget and click on the add button the given input gets displayed in the textview widget.
Reader Level:

Introduction

In this application we used label, textview, button and entry widgets to design an application.

Working

In this application, when we put any text input into the entry widget and click on the add button, the given input get displayed in the textview widget.

Designing
 
Step 1 : Open MonoDevelop.

d1.gif

Step 2 : Create a new solution and rename it.

1.gif

2.gif

Step 3 : Go to the designer mode, take a vbox widget and add label ,text view ,entry and entry widgets to the MainWindow.


5.gif


6.gif


Overall Designing as given below. 

24-nov.gif

Program

using System;
using Gtk;
public partial class MainWindow : Gtk.Window
{
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();
    }
    protected void OnDeleteEvent(object sender, DeleteEventArgs a)
    {
        Application.Quit();
        a.RetVal = true;
    }
    protected void onbuttonclick(object sender, System.EventArgs e)
    {
        textview1.Buffer.Text = entry1.Text;
    }
}

Output : To run Press Ctrl+F5

RUN.gif


24-nov-2.gif

Enter the desired input into the entry widget as show below.

24-nov-3.gif

After clicking on the "click to add in TextView widgets"

24-nov-4.gif

Login to add your contents and source code to this article
post comment
     

How about the deployment of the solution created ? Is it possible to create an exe that works on any platforms? What are the steps for that?

Posted by jibin mathew May 25, 2012
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.
Join a Chapter