2009/9/25 Murray Cumming <[email protected]>: > On Fri, 2009-09-25 at 10:30 +0000, Sever P A wrote: >> 2009/9/25 Sever P A <[email protected]>: >> > 2009/9/20 Murray Cumming <[email protected]>: >> >> On Sat, 2009-09-19 at 10:04 +0200, Sever P A wrote: >> >>> * Are the same the value of xkl_engine_get_instance (Display * >> >>> display) [of LibXklavier] than the value pointed of >> >>> Gtk::Main::instance() ...? >> >> >> >> No, they are entirely unrelated. >> >> >> >> Googling suggests that you can use GDK_DISPLAY() to get the Display*. >> >> Thats an X Windows thing. >> >> http://developer.gimp.org/api/2.0/gdk/gdk-X-Window-System-Interaction.html#GDK-DISPLAY:CAPS >> > >> > Thanks to Murray Cumming's answer, and after a few reading of the API >> > reference, I done, >> > >> > Gdk::Display dpy; >> > XklEngine * engine; >> > engine = xkl_engine_get_instance(dpy.get_default()); >> > >> > But the compiler tells me, >> > >> > error: cannot convert ‘Glib::RefPtr<Gdk::Display>’ to ‘Display*’ for >> > argument ‘1’ to ‘XklEngine* xkl_engine_get_instance(Display*)’ >> > >> > What's wrong ?... Are the pointer "*" and "Glib::RefPtr" not the same >> > ?... Could be solved anyway ?... > > No, of course they are not. You are missing some basic C and C++ > knowledge. > > gobj() can help in this kind of situation - see the Basics chapter of > the gtkmm book. > > But you should just use GDK_DISPLAY, as I suggested. > >> Ups ! sorry, I just see that it's not also possible to do >> >> Gdk::Display dpy; >> >> What do you suggest ? > > I doubt that you'll be able to use the xkl API without learning more > about C and C++. >
I'm always firmly decided to learn more and more C++/GTKmm programming although as I already said elsewhere, I'm not a computer technician. That would be very instructive for me is to find the guidelines that explains how integrate LibXklavier in a GTKmm programmes or simple code examples that covers all of this. I know that it's possible to work with these two libraries together independently but I'm trying to avoit XOpenDisplay()/XCloseDisplay() while I suspect that Gtk::Main objects do the same. So, another way to ask the same is what would I do (especifically, which concrete and valid steps) to get a correct XklEngine * engine value ?. I would appreciate very much your help... S. _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
