[gtkmm] Gtkmm/Gdkmm and Gtk/Gdk
- From: Stephan Zaubzer <s zaubzer gmx at>
- To: gtkmm-list gnome org
- Subject: [gtkmm] Gtkmm/Gdkmm and Gtk/Gdk
- Date: Fri, 06 Feb 2004 23:13:56 +0100
Is it possible, that a few things that are available in Gtk aren't
available in Gtkmm?
To be specific:
My Problem: I want to capture a "hotkey combination" in an application
even if the app is in the background. As far as I know, this is only
possible when using the XGrabKey function from Xlib. This function takes
as arguments the XDisplay and XWindow and some other values. When using
Gtk I have the function
XDisplay gdk_x11_display_get_xdisplay(GdkDisplay * display)
which returns an XDisplay. In Gdkmm no such function exists.
Another function (memberfunction of the Gdk::Window Class) is
void Gdk::Window::add_filter(GdkFilterFunc, gpointer data)
This function doesn't seem to be equivalent to the coresponding
gdk_window_add_filter(GdkWindow * window, GdkFilterFunc, gpointer data)
function. In
http://www.gtkmm.org/gtkmm2/docs/reference/html/classGdk_1_1Window.html#a21
the description says, that for filtering all events for all windows, I
have to pass 0 for Window (which is true for the Gdk function but not
for the Gdk::Window member function). In addition the function prototype
GdkFilterFunc is not defined in the Gdkmm headers, but in the Gdk
headers (which are included in the Gdkmm headers). This function takes
as arguments GdkEvent, which is also from Gdk and not Gdkmm. So to the
code in the filterfunction has to contain Gdk and not Gdkmm code.
Is this supposed to be so, or will this change in future versions?
What is, if I use for example the gdk_x11_display_get_xdisplay function
in a C++ programm? Do I have to include the headers with extern "C"
(because it is a function of the Gtk library, which is written in C)?
Am I right saying, that for certain things Gtkmm doesn't suffice (in its
current version) and you have to use Gtk additionally in your program.
For the example I gave, I can see no better solution, but it works, but
it is kind of messy using both Gtk/Gdk and Gtkmm/Gdkmm in the same
application...
regards
Stephan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]