Reply
Thread Tools
Posts: 2 | Thanked: 4 times | Joined on Jun 2010
#1
Hey everyone,

I was going to ask a question here, but it seems I may have already solved it myself.

I thought I might let those who find it interesting know that I'm trying to write a Glade Catalog (for Glade-3) to more easily be able to more easily design windows.

For people interested in either using it or helping with it, it can be found here: http://gist.github.com/413151

If you are going to use it, it either needs to be located in Glade's catalog directory (/usr/share/glade3/catalogs for me) or set the GLADE_CATALOG_PATH variable to the directory containing it.

You, of course, need to have libhildon installed (libhildon-1-0 and libhildon-1-dev in Ubuntu 10.04 and libhildon and libhildon-devel in fedora 13) and at the right version, probably would be best to build the lastest version yourself (fedora's libhildon version is old)

And if you are going to use GTK controls in your apps as well, be sure to select the right GTK version in your project preferences, since that caused the problem I was initially going to ask, glade told gtkbuilder gtk 2.16 was needed and maemo only has 2.14, so when I'd add a gtk widget the xml wouldn't be parsed correctly.

Attached is the glade file (renamed to txt so I could upload it) I used to test it, made with glade, no editing after (except rename).
As you can see it uses a hildonwindow, with a hildonpannablearea, then a gtkviewport and a gtkvbox to show 20 hildonbuttons.
Here's the code I used to load it:
Code:
#include <gtk/gtk.h>

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

  gtk_init(&argc, &argv);

  builder = gtk_builder_new();
  gtk_builder_add_from_file(builder, "test.txt", NULL);

  window = GTK_WIDGET(gtk_builder_get_object(builder, "window1"));

  g_object_unref(G_OBJECT(builder));

  gtk_widget_show_all(window);

  gtk_main();

  return 0;
}
And built with:
Code:
gcc main.c -o gladetest `pkg-config hildon-1 --cflags --libs`
Tested with maemo-sdk as:
Code:
run-standalone.sh ./gladetest
Attached Files
File Type: txt test.txt (10.7 KB, 119 views)

Last edited by slash; 2010-06-15 at 20:25. Reason: Forgot the -dev packages needed
 

The Following 3 Users Say Thank You to slash For This Useful Post:
Posts: 85 | Thanked: 38 times | Joined on Sep 2010 @ Canada
#2
Thank you slash for this effort. I think it should make GTK+ development more accessible for the n900. To tell you the truth I went the Qt way just because of the UI designer.
 
Posts: 1 | Thanked: 0 times | Joined on Jan 2011
#3
Nice work, but I'm getting an error message:
Code:
GLIB CRITICAL ** Gtk - gtk_widget_show_all: assertion `GTK_IS_WIDGET (widget)' failed
How should I fix it?
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#4
Originally Posted by prid View Post
How should I fix it?
Step 1 is to supply the minimal source code that generates the error.
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:31.