Why does my theme crash at startup?



Hi,

I currently try to write my own simple theme with just some overwritten drawing functions and no seperate gtkrcstyle implementation.

However at startup my theme sigsev's:

Program received signal SIGSEGV, Segmentation fault.
gtk_rc_parse_engine (context=0x80ab800, scanner=0x80abf48, rc_style=0xbfbb87d8)
    at gtkrc.c:3663
3663              new_class = GTK_RC_STYLE_GET_CLASS (new_style);
(gdb) bt
#0  gtk_rc_parse_engine (context=0x80ab800, scanner=0x80abf48,
    rc_style=0xbfbb87d8) at gtkrc.c:3663
#1  0xb7d70e80 in gtk_rc_parse_style (context=0x80ab800, scanner=0x80abf48)
    at gtkrc.c:3133
#2  0xb7d719aa in gtk_rc_parse_any (context=0x80ab800,


As I said my goal is to stay as simple as possible, if possible I would like to use the unmodified GtkRcStyle implementation instead of writing my own.

It would be wonderful if sombody could have a quick look at my code, maybe its a trivial problem.

Thanks you, angi

This is my code to set my engine up, i copied it from another theme:

#include <gmodule.h>
#include <gtk/gtk.h>
#include "angistyle.h"


G_MODULE_EXPORT void
theme_init (GTypeModule *module)
{
static const GTypeInfo object_info =
  {
    sizeof (GtkRcStyleClass),
    (GBaseInitFunc) NULL,
    (GBaseFinalizeFunc) NULL,
    (GClassInitFunc) NULL,
    NULL,           /* class_finalize */
    NULL,           /* class_data */
    sizeof (GtkRcStyle),
    0,              /* n_preallocs */
    (GInstanceInitFunc) NULL,
  };
g_type_module_register_type (module,
                    GTK_TYPE_RC_STYLE,
                    "AngiRcStyle",
                    &object_info, 0);



  static const GTypeInfo object_info2 =
  {
    sizeof (GtkStyle),
    (GBaseInitFunc) NULL,
    (GBaseFinalizeFunc) NULL,
    (GClassInitFunc) NULL,
    NULL,           /* class_finalize */
    NULL,           /* class_data */
    sizeof (AngiStyle),
    0,              /* n_preallocs */
    (GInstanceInitFunc) NULL,
  };
   g_type_module_register_type (module,
                 GTK_TYPE_STYLE,
                 "AngiStyle",
                 &object_info2, 0);

}

G_MODULE_EXPORT void
theme_exit (void)
{
}

G_MODULE_EXPORT GtkRcStyle *
theme_create_rc_style (void)
{
  return (GtkRcStyle *)g_object_new (GTK_RC_STYLE, NULL);
}

/* The following function will be called by GTK+ when the module
 * is loaded and checks to see if we are compatible with the
 * version of GTK+ that loads us.
 */
G_MODULE_EXPORT const gchar* g_module_check_init (GModule *module);
const gchar*
g_module_check_init (GModule *module)
{
  return gtk_check_version (GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION - GTK_INTERFACE_AGE);
}




Express yourself instantly with MSN Messenger! MSN Messenger


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