Igor H. Vieira
2013-01-14 11:11:40 UTC
I've did a research on the Internet looking for tutorials/documentations to
explain me how to use a UI designed in Glade in a Java Gnome project, but
no luck. I already know how to create a UI from the code using the Java
Gnome/GTK. Anyway, I'd like to use a Glade UI that I've created in a Java
Gnome/Gtk project, but I have no idea from where to start. Please tell me:
- which packages I need to install;
- how to integrate the UI I've create with Glade (the .glade file) with my
Java Gnome/Gtk project (specifically in Eclipse);
- and give an example.
Thanks in advance.
That's how my Glade UI looks (Just click the image to see it bigger):
Loading Image...
This is the XML code of the UI above:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="window_position">center</property>
<child>
<object class="GtkFixed" id="fixed1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkEntry" id="entry1">
<property name="width_request">162</property>
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="valign">end</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="x">11</property>
<property name="y">49</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry2">
<property name="width_request">162</property>
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="valign">end</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
</object>
<packing>
<property name="x">271</property>
<property name="y">49</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">*</property>
</object>
<packing>
<property name="x">216</property>
<property name="y">49</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button">
<property name="label"
translatable="yes">Calculate!!!</property>
<property name="use_action_appearance">False</property>
<property name="width_request">84</property>
<property name="height_request">27</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="x">181</property>
<property name="y">93</property>
</packing>
</child>
</object>
</child>
</object>
</interface>
explain me how to use a UI designed in Glade in a Java Gnome project, but
no luck. I already know how to create a UI from the code using the Java
Gnome/GTK. Anyway, I'd like to use a Glade UI that I've created in a Java
Gnome/Gtk project, but I have no idea from where to start. Please tell me:
- which packages I need to install;
- how to integrate the UI I've create with Glade (the .glade file) with my
Java Gnome/Gtk project (specifically in Eclipse);
- and give an example.
Thanks in advance.
That's how my Glade UI looks (Just click the image to see it bigger):
Loading Image...
This is the XML code of the UI above:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<property name="window_position">center</property>
<child>
<object class="GtkFixed" id="fixed1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkEntry" id="entry1">
<property name="width_request">162</property>
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="valign">end</property>
<property name="invisible_char"></property>
</object>
<packing>
<property name="x">11</property>
<property name="y">49</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry2">
<property name="width_request">162</property>
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="valign">end</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
</object>
<packing>
<property name="x">271</property>
<property name="y">49</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label">
<property name="height_request">25</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">*</property>
</object>
<packing>
<property name="x">216</property>
<property name="y">49</property>
</packing>
</child>
<child>
<object class="GtkButton" id="button">
<property name="label"
translatable="yes">Calculate!!!</property>
<property name="use_action_appearance">False</property>
<property name="width_request">84</property>
<property name="height_request">27</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_action_appearance">False</property>
</object>
<packing>
<property name="x">181</property>
<property name="y">93</property>
</packing>
</child>
</object>
</child>
</object>
</interface>