Discussion:
Glade and org.gnome.gtk.Builder
Jason Martin
2012-09-06 00:28:02 UTC
Permalink
I have wrote a medium sized app with the bindings and they work well.
But I have not been able to get org.gnome.gtk.Builder working with even the
simplest example.
Should I be using a certain version of Glade?

Using Ubuntu 12.04

OpenJDK 7 and Sun Java6

Glade 3.8 and 3.12
Jason Martin
2012-09-15 10:21:31 UTC
Permalink
OK, got it to work but I had to define the object types to use first or it
would not parse the file.

Example simple window with one button

w = window
b = button

So, that means I have to know what is in the builder/glade file before
hand?
Post by Jason Martin
I have wrote a medium sized app with the bindings and they work well.
But I have not been able to get org.gnome.gtk.Builder working with even
the simplest example.
Should I be using a certain version of Glade?
Using Ubuntu 12.04
OpenJDK 7 and Sun Java6
Glade 3.8 and 3.12
Andrew Cowie
2012-09-16 06:27:08 UTC
Permalink
Post by Jason Martin
OK, got it to work but I had to define the object types to use first
or it would not parse the file.
Hm, I thought I'd sent a reply to your first message, though all I was
going to say is "can you show us the code that isn't working?"
Post by Jason Martin
So, that means I have to know what is in the builder/glade file before
hand?
Um, no, you shouldn't; just getting a reference to the top level Window
object should be more than enough.

You did call w.showAll(); right?

AfC
Sydney
Jason Martin
2012-09-17 01:11:37 UTC
Permalink
I am making it work doing some funny stuff on Ubuntu 12.04 with 4.1.2 from
the java-gnome ppa.

I can not get Designer.java to work with simple.ui sample.

http://research.operationaldynamics.com/bzr/java-gnome/mainline/tests/prototype/Designer.java


***@Michelle:~/TESTING$ javac Designer.java
***@Michelle:~/TESTING$ java Designer
Exception in thread "main" java.text.ParseException: Invalid object type
`GtkLabel'
at org.gnome.gtk.Builder.addFromFile(Builder.java:107)
at Designer.setupUserInterface(Designer.java:46)
at Designer.main(Designer.java:80)
***@Michelle:~/TESTING$


I can then pre-define Label() or whatever widget before calling builder and
it works.

And in my case, I have done some glade files with hundreds of widgets.
As long as define say one widget type of say a Spinbutton then it will
load the other 50 spinbuttons fine.
Andrew Cowie
2012-09-17 02:50:03 UTC
Permalink
Post by Jason Martin
I can then pre-define Label() or whatever widget before calling
builder and it works.
Ah, damn. Not your fault. There is an engineering problem and
unfortunately the person working on it has been busy with other work the
past year.

Have a read of
http://article.gmane.org/gmane.comp.gnome.bindings.java.devel/1606

For the mean time, the workaround of forcing instantiation of the
[native] class is indeed going to work. I'll see if we can get our heads
together to get a more proper fix. Clearly this sucks; I'll start a
thread on java-gnome-hackers.

AfC
Sydney
Jason Martin
2012-09-17 14:43:06 UTC
Permalink
Thanks, so far other than that they are some really nice bindings and I
definitely want to see them stay around.


On Sun, Sep 16, 2012 at 10:50 PM, Andrew Cowie <
Post by Andrew Cowie
Post by Jason Martin
I can then pre-define Label() or whatever widget before calling
builder and it works.
Ah, damn. Not your fault. There is an engineering problem and
unfortunately the person working on it has been busy with other work the
past year.
Have a read of
http://article.gmane.org/gmane.comp.gnome.bindings.java.devel/1606
For the mean time, the workaround of forcing instantiation of the
[native] class is indeed going to work. I'll see if we can get our heads
together to get a more proper fix. Clearly this sucks; I'll start a
thread on java-gnome-hackers.
AfC
Sydney
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
java-gnome-developer mailing list
https://lists.sourceforge.net/lists/listinfo/java-gnome-developer
Vreixo Formoso Lopes
2012-09-18 14:06:11 UTC
Permalink
Hi!

I had worked on that a long time ago. However, I've been really busy the last year, so I had no time to finish it.
I case any of you is interested on this, I have pushed the last code I had to:

http://research.operationaldynamics.com/bzr/java-gnome/hackers/vreixo/gtkbuilder/

The approach is rather different to both Gtk+ and the old java-gnome way of handling glade-based UI.
My approach makes use of java annotations, which provides an elegant and highly productive way of dealing with the loading of glade-based files.
It is based on an old (and great!) code submitted by Franco Bulgarelli.

I remember to have written some examples/demos, so I hope that would be enough for you to understand
how this works.
In any case, I think I have not finished the support for thing like handlers. In fact, my local branch has several uncommitted

changes related with handler support.
Unfortunately, my last commit is almost a year ago, and I don't really remember what my code was or what parts were missing.
I would need to spend some time on it, but I am writing my PhD thesis right now and I have no time for this, I'm really sorry.
I just remember most of the work was already done. I will try to finish this as long as I have time, but that won't be at least until November.
Please remember me my commitment if you don't hear anything from me by then.

In any case, if any of you wants to continue my work, be free to contact me. I be willing to send you the uncommitted changes I have and help you as most as I can.

Best regards
Vreixo





----- Mensagem original -----
De: Andrew Cowie <andrew-2KHxOkysSnqmy7d5DmSz6TlRY1/***@public.gmane.org>
Para: java-gnome-developer-5NWGOfrQmneRv+***@public.gmane.org
Cc: Vreixo Formoso Lopes <metalpain2002-***@public.gmane.org>
Enviadas: Segunda-feira, 17 de Setembro de 2012 4:50
Assunto: Re: [Java-gnome-developer] Glade and org.gnome.gtk.Builder
Post by Jason Martin
I can then pre-define Label() or whatever widget before calling
builder and it works.
Ah, damn. Not your fault. There is an engineering problem and
unfortunately the person working on it has been busy with other work the
past year.

Have a read of
http://article.gmane.org/gmane.comp.gnome.bindings.java.devel/1606

For the mean time, the workaround of forcing instantiation of the
[native] class is indeed going to work. I'll see if we can get our heads
together to get a more proper fix. Clearly this sucks; I'll start a
thread on java-gnome-hackers.

AfC
Sydney

Loading...