Created
December 29, 2013 20:28
-
-
Save b4n/8174461 to your computer and use it in GitHub Desktop.
Issue with GtkActionGroup inside GtkBuilder definitions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <gtk/gtk.h> | |
int | |
main (int argc, | |
char **argv) | |
{ | |
GObject *object; | |
GtkBuilder *builder; | |
GError *err = NULL; | |
gtk_init (&argc, &argv); | |
builder = gtk_builder_new (); | |
if (! gtk_builder_add_from_file (builder, "window.ui", &err)) | |
g_error ("Failed to load UI file: %s", err->message); | |
gtk_builder_connect_signals (builder, NULL); | |
object = gtk_builder_get_object (builder, "window1"); | |
gtk_widget_show_all (GTK_WIDGET (object)); | |
gtk_main (); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<interface> | |
<requires lib="gtk+" version="2.16"/> | |
<!-- interface-naming-policy project-wide --> | |
<object class="GtkActionGroup" id="actiongroup1"> | |
<child> | |
<object class="GtkAction" id="quit"> | |
<property name="label">_Quit</property> | |
<property name="stock_id">gtk-quit</property> | |
<signal name="activate" handler="gtk_main_quit"/> | |
</object> | |
<accelerator key="Q" modifiers="GDK_CONTROL_MASK"/> | |
</child> | |
</object> | |
<object class="GtkWindow" id="window1"> | |
<signal name="destroy" handler="gtk_main_quit" /> | |
<child> | |
<object class="GtkVBox" id="vbox1"> | |
<property name="visible">True</property> | |
<child> | |
<object class="GtkMenuBar" id="menubar1"> | |
<property name="visible">True</property> | |
<child> | |
<object class="GtkMenuItem" id="menuitem1"> | |
<property name="visible">True</property> | |
<property name="label">_File</property> | |
<property name="use_underline">True</property> | |
<child type="submenu"> | |
<object class="GtkMenu" id="menu1"> | |
<property name="visible">True</property> | |
<child> | |
<object class="GtkImageMenuItem" id="imagemenuitem1"> | |
<property name="visible">True</property> | |
<property name="related_action">quit</property> | |
<property name="use_action_appearance">True</property> | |
</object> | |
</child> | |
</object> | |
</child> | |
</object> | |
</child> | |
</object> | |
<packing> | |
<property name="expand">False</property> | |
<property name="position">0</property> | |
</packing> | |
</child> | |
</object> | |
</child> | |
</object> | |
</interface> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment