[maemo-developers] [maemo-developers] [vkb] gtk_context_im_show|hide
From: Tomas Junnonen tomas.junnonen at nokia.comDate: Tue Jun 6 17:10:32 EEST 2006
- Previous message: [maemo-developers] [vkb] gtk_context_im_show|hide
- Next message: [maemo-developers] [vkb] gtk_context_im_show|hide
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ext Antonio Gomes wrote: > I got it. Thanks Tomas ... > > Just one more question: is it ok to have more than one instance of > gtk_im_context for the same app ? I am asking because currently I'm > doing like this: for each new created window I have a instance of > gtk_im_context tied to it (as an instance variable) - and everything > works fine until the moment I close my first window: the vkb stops > poping up after my custom editable forms get focus (it keeps working > if I close any other window instead of the first one though). I do not > understand this behaviour once each window has its own gtk_im_context > instance ... > > So my question is: can I have more than one instance of gtk_im_context > objects for the same app, or should I declare it a static variable > (only a single object tied to class instead of instance) ? In GTK apps each standard text widget has its own context that is internal to the widget. So yes, you can have multiple contexts. I suggest you look at the source code of GTK, specifically at the part of GtkEntry that deals with the context creation and use. While you could associate a context with each window, it probably makes more sense to keep the contexts internal to your custom widgets. The context also keeps some limited state, so it's best to have one context per instance of your forms. Regards, Tomas
- Previous message: [maemo-developers] [vkb] gtk_context_im_show|hide
- Next message: [maemo-developers] [vkb] gtk_context_im_show|hide
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]