failing of object initializing

Kees Scherpenhuijzen noik00 at gmail.com
Wed Oct 21 17:40:40 CEST 2009


Hey there,

Since the change from thunar-vfs to GIO i'm getting back in touch with
Thunar. I'm trying to create a plugin for thunar.
I've tried making a new object with a window in it but this seems to
be failing all the time.

The creation of the object i tried as followed:
#ifndef __THUNAR_TA_WINDOW_H__
#define __THUNAR_TA_WINDOW_H__

#include <thunarx/thunarx.h>

G_BEGIN_DECLS;

typedef struct _ThunarTaWindowClass ThunarTaWindowClass;
typedef struct _ThunarTaWindow      ThunarTaWindow;

#define THUNAR_TA_TYPE_WINDOW             (thunar_ta_window_get_type ())
#define THUNAR_TA_WINDOW(obj)             (G_TYPE_CHECK_INSTANCE_CAST
((obj), THUNAR_TA_TYPE_WINDOW, ThunarTaWindow))
#define THUNAR_TA_WINDOW_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST
((klass), THUNAR_TA_TYPE_WINDOW, ThunarTaWindowClass))
#define THUNAR_TA_IS_WINDOW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE
((obj), THUNAR_TA_TYPE_WINDOW))
#define THUNAR_TA_IS_WINDOW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE
((klass), THUNAR_TA_TYPE_WINDOW))
#define THUNAR_TA_WINDOW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS
((obj), THUNAR_TA_TYPE_WINDOW, ThunarTaWindowClass))

GType      thunar_ta_window_get_type      (void) G_GNUC_CONST;
void       thunar_ta_window_register_type (ThunarxProviderPlugin *plugin);

G_END_DECLS;

#endif /* !__THUNAR_TA_WINDOW_H__ */


#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
////
#include "ta-window.h"

static void thunar_ta_window_response(GtkDialog *, gint);
static gboolean thunar_ta_window_key_press_event (GtkWidget *, GdkEventKey *);


struct _ThunarTaWindowClass
{
  GtkDialogClass __parent__;
};

struct _ThunarTaWindow
{
  GtkDialog __parent__;
};

THUNARX_DEFINE_TYPE (ThunarTaWindow, thunar_ta_window, GTK_TYPE_DIALOG);

static void thunar_ta_window_class_init (ThunarTaWindowClass *klass)
{
}



static void thunar_ta_window_init (ThunarTaWindow *ta_window)
{
  //window things
}
/////
so when doing:
  	dialog = g_object_new (THUNAR_TA_TYPE_WINDOW, NULL);
it gives a (lt-Thunar:9832): GLib-GObject-CRITICAL **: g_object_new:
assertion `G_TYPE_IS_OBJECT (object_type)' failed
What is wron with the creation of object?
-- 
Kees



More information about the Xfce4-dev mailing list