libglade help



I'm trying to use xml to create gnome apps.  As of right now, I can get
my program to run, but nothing is displayed.  Can anyone help me?  Below
I have included both my glade1.c source file with my glade1.glade file. 
Thank you for any help you can give!

Robert


// glade1.c
#include <stdio.h>
#include <stdlib.h>
#include <gnome.h>
#include <glade/glade.h>


#define VERSION "1.0"


const char *filename="glade1.glade";
static GtkWidget *app;


int main (int argc, char *argv[])
{
    GladeXML *xml;

    gnome_init("glade1",VERSION, argc, argv);
    glade_gnome_init();

    xml = glade_xml_new(filename,"glade1");
    if(!xml) {
        g_warning("Could not load the interface!\n");
        exit(EXIT_FAILURE);
    }
    app = glade_xml_get_widget(xml,"app1");
    glade_xml_signal_autoconnect(xml);

    gtk_object_unref(GTK_OBJECT(xml));

    //gtk_widget_show(app);
    
    gtk_main();

    exit(EXIT_SUCCESS);
}


<?xml version="1.0"?>
<GTK-Interface>

<project>
  <name>glade1</name>
  <program_name>glade1</program_name>
  <directory></directory>
  <source_directory>src</source_directory>
  <pixmaps_directory>pixmaps</pixmaps_directory>
  <language>C</language>
  <gnome_support>True</gnome_support>
  <gettext_support>True</gettext_support>
</project>

<widget>
  <class>GnomeApp</class>
  <name>app1</name>
  <title>Glade1</title>
  <type>GTK_WINDOW_TOPLEVEL</type>
  <position>GTK_WIN_POS_NONE</position>
  <modal>False</modal>
  <allow_shrink>False</allow_shrink>
  <allow_grow>True</allow_grow>
  <auto_shrink>False</auto_shrink>
  <enable_layout_config>True</enable_layout_config>

  <widget>
    <class>GnomeDock</class>
    <child_name>GnomeApp:dock</child_name>
    <name>dock1</name>
    <allow_floating>True</allow_floating>
    <child>
      <padding>0</padding>
      <expand>True</expand>
      <fill>True</fill>
    </child>

    <widget>
      <class>Placeholder</class>
      <child_name>GnomeDock:contents</child_name>
    </widget>
  </widget>

  <widget>
    <class>GnomeAppBar</class>
    <child_name>GnomeApp:appbar</child_name>
    <name>appbar1</name>
    <has_progress>True</has_progress>
    <has_status>True</has_status>
    <child>
      <padding>0</padding>
      <expand>True</expand>
      <fill>True</fill>
    </child>
  </widget>
</widget>

</GTK-Interface>




This message was content scanned for viruses by the TLU McAfee Webshield.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]