Re: Can I make a IM Module resident?



Hi,
I tried to use g_type_module_register_type () to register my class. This time, the application is never crashed, but the IM module is never unloaded. What's the matter with it?

Regards
James Su


Owen Taylor wrote:

On Fri, 2003-03-28 at 03:31, James Su wrote:
Oh, I see. But the interface of this function is different with the static one, could you please give me some hint on how to use it?

The GTypeInfo parameter is replaced by a GTypePlugin pointer. Could you please tell me how can I convert a GTypeInfo into GTypePlugin?

The idea of GTypePlugin is that you provide information to GObject
as to how to load your type when necessary.

However, you don't need to provide your own GTypePlugin or
use g_type_register_dynamic() directly... what the GTypeModule parameter passed to your init() is is basically an
implementation of GTypePlugin that is already set up to for you
use.

Just use g_type_module_register_type() rather than g_type_register_static(). There are multiple examples of this in the provided input modules, or for more examples, you can look at the theme engines in the gtk-engines/ modules. (They
generally register two types .. one GtkStyle type and one
GtkRcStyle type.)

Regards,
                                 Owen

Regards
James Su

Sven Neumann wrote:

Hi,

James Su <suzhe gnuchina org> writes:



Then, how can I use my own class within a IM module? There is no type
register function like g_type_register_dynamic.
I'm pretty sure there is exactly this function. But don't take my word
that this is the right way to do this, I'm more or less only guessing
here.


_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list








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