Re: event get focus




On Apr 12, 2005, at 2:10 AM, trupthi n t wrote:

 To write/find a function which returns the the widget on which
         the current focus is,when i used the following function,

 GtkWidget*  gtk_window_get_focus(GtkWindow *window);

 the compiler(gtk+1.2.10) gave the following error:

Firstly, this list is about development *of* gtk+, not *with* gtk+. Please direct these questions at gtk-list or gtk-app-devel-list.

Secondly, gtk+ 1.2 is old, obsolete, deprecated, and unsupported. The function you want to call exists in gtk+ 2.x, not gtk+ 1.x.
http://developer.gnome.org/doc/API/2.0/gtk/GtkWindow.html#id2959364

To replicate this function call in gtk+ 1.2, you'd have to do

   focus_widget = window->focus_widget;


 [root localhost test]# make
 gcc `gtk-config --cflags`  foc.c -o foc `gtk-config --libs`
 foc.c: In function `fovu':
foc.c:60: warning: assignment makes pointer from integer without a cast

this means that the compiler is using the implicit type for the function since it found no prototype, and the implicit type (int) does not match how it is being used. this is your first clue.

 /tmp/ccbfegod.o(.text+0x297): In function `fovu':
 : undefined reference to `gtk_window_get_focus'
 collect2: ld returned 1 exit status
 make: *** [foc] Error 1

the undefined reference means that the linker can't find the function.


Kindly help as to how to proceed.

use gtk+ 2.x.



--
Without treatment, a common cold will last about seven days.
With treatment, it will last about a week.
  -- conventional wisdom




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