LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-18-2011, 05:14 PM   #1
wd5jhi
LQ Newbie
 
Registered: Apr 2011
Location: Live in Kerrville, TX
Distribution: Ubuntu 10.10
Posts: 2

Rep: Reputation: Disabled
Trying to interface Glade 3.6.7 and 'C' in Ubuntu 10.10


Hi, this is my first time here:

I've been programming GUI software in C# in MonoDev for some time now. I just noticed that I can use my favorite language, C, with Glade to do the same thing. I've been going through some tutorials with a little frustration with them. Some seem to be written for older Glade versions.

The latest example had me save my Glade project to a "tutorial.glade" file. Then run it through a 'gtk-builder-convert' utility.

Problem: the utility program returns errors indicating the the tutorial.glade file was written badly, that there is supposed to be a <glade-interface> tag that is missing.

Any ideas???


Glade file:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="window">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_STRUCTURE_MASK</property>
<property name="title" translatable="yes">GTK+ Text Editor</property>
<signal name="destroy" handler="on_window_destroy"/>
<child>
<placeholder/>
</child>
</object>
</interface>


C-code:
#include <gtk/gtk.h>

void on_window_destroy (GtkObject *object, gpointer user_data)
{
gtk_main_quit ();
}

int main (int argc, char *argv[])
{
GtkBuilder *builder;
GtkWidget *window;

gtk_init (&argc, &argv);

builder = gtk_builder_new ();
gtk_builder_add_from_file (builder, "tutorial.xml", NULL);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_builder_connect_signals (builder, NULL);

g_object_unref (G_OBJECT (builder));

gtk_widget_show (window);
gtk_main ();

return 0;
}

Last edited by wd5jhi; 04-18-2011 at 05:18 PM.
 
Old 04-19-2011, 09:13 AM   #2
wd5jhi
LQ Newbie
 
Registered: Apr 2011
Location: Live in Kerrville, TX
Distribution: Ubuntu 10.10
Posts: 2

Original Poster
Rep: Reputation: Disabled
Found the problem:
The newest version of Glade, that I have, does not require using the 'gtk-builder-convert' utility. So I was confusing the issue. It works now. Hope no one spent too much time look at it.

Wow, I can write GUI apps in C. Gotta love Linux.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
interface not responding in glade 3 / gtk with C axd Linux - Newbie 3 02-10-2011 12:09 PM
glade interface on_a_work Programming 1 01-27-2011 10:10 AM
Glade Interface Designer raghuveerbabu Programming 9 08-26-2007 07:18 AM
Glade Interface Designer - Help me !!! tuanngochut Solaris / OpenSolaris 1 01-05-2006 09:17 AM
GTK+(GLADE interface designer) santhosh.linux Programming 3 01-02-2006 12:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration