Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1064685

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:39:21+00:00 2026-05-16T19:39:21+00:00

I’ve been trying to get started with Mono & GTK# (I come from a

  • 0

I’ve been trying to get started with Mono & GTK# (I come from a background of Qt/C++ GUI programming) and decided to start with a very simple test GUI.

I installed the MS Windows Mono/GTK# installer and then, upon finding that the Start menu link to Glade didn’t work (as it didn’t appear to be included in the package), I used the “Glade with GTK+” Windows binary installer from the Glade website.

I then created a very simple GUI in Glade (at the bottom of this post) and wrote my first bit of C# code to display it. However, it doesn’t seem to be working properly.

The “Hello, World!” is printed to the console correctly and then the program hangs without the window appearing or any error messages being printed. It seems as if the window has been created and the event loop has started but that it is not being made visible. I’ve tried removing the first null from the new Glade.XML line and not including the glade file as a resource, but that made no difference.

I’ve also tried replacing the Glade GUI xml with the one on the GtkSharpBeginnersGuide on the mono website (and changing wndTestWindow to window1 in the C# code) and it seems to work perfectly implying that there’s a problem with my Glade XML. However, I’m finding it hard to figure out what’s wrong with the XML created by my Glade installation. Can anyone offer any suggestions?

Glade GUI:

<?xml version="1.0"?>
<glade-interface>
  <!-- interface-requires gtk+ 2.12 -->
  <!-- interface-naming-policy project-wide -->
  <widget class="GtkWindow" id="wndTestWindow">
    <property name="title" translatable="yes">Test Window</property>
    <property name="window_position">center</property>
    <child>
      <widget class="GtkVBox" id="vboxTopLevel">
        <property name="visible">True</property>
        <property name="orientation">vertical</property>
        <child>
          <widget class="GtkHBox" id="hboxComboList">
            <property name="visible">True</property>
            <child>
              <widget class="GtkLabel" id="lblList">
                <property name="visible">True</property>
                <property name="label" translatable="yes">Here's a list:</property>
              </widget>
              <packing>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <widget class="GtkComboBox" id="cmbList">
                <property name="visible">True</property>
              </widget>
              <packing>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <widget class="GtkButton" id="btnList">
                <property name="label" translatable="yes">Do something</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
              </widget>
              <packing>
                <property name="position">2</property>
              </packing>
            </child>
          </widget>
          <packing>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <widget class="GtkHButtonBox" id="hbtnboxButtonRow">
            <property name="visible">True</property>
            <child>
              <widget class="GtkButton" id="btnOK">
                <property name="label">gtk-ok</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="use_stock">True</property>
              </widget>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <widget class="GtkButton" id="btnCancel">
                <property name="label">gtk-cancel</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="use_stock">True</property>
              </widget>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">1</property>
              </packing>
            </child>
          </widget>
          <packing>
            <property name="position">1</property>
          </packing>
        </child>
      </widget>
    </child>
  </widget>
</glade-interface>

C# Test Code:

using Glade;
using Gtk;
using System;

class TestApplication
{
    static void Main(string[] args)
    {
        System.Console.Write("Hello, World!\n");
        new TestApplication(args);
    }

    public TestApplication(string[] args)
    {
        Gtk.Application.Init();

        Glade.XML gxml = new Glade.XML(null, "test_mono.glade", "wndTestWindow", null);
        gxml.Autoconnect(this);
        Gtk.Application.Run();
    }
}

Compiled and run with:

mcs -pkg:glade-sharp-2.0 -resource:test_mono.glade test_mono.cs
mono .\test_mono.exe

Versions:

Windows: XP Service Pack 3
Glade: 3.6.7
MCS Version 2.6.7.0
Mono & GTK# installed using mono-2.6.7-gtksharp-2.12.10-win32-2.exe from the Mono website.

Compiled & tested both using cygwin and the “Mono-2.6.7 Command Prompt”.

  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.