Re: Problem with Tabs



TORRI Vincent wrote:
n Fri, 28 Feb 2003, Scott Burns wrote:

  
All the program does is create a window with a button in it, and then 
every second print out the memory location of the currently focused object.

What I find is that when I press tab focus moves to something I can't 
see and I start getting NULL as the location of the currently focused 
object.  When I don't set the default object for the window, it starts 
with focus on the null object.  Pressing tab again toggles between the 
null object ans the button.

The same thing happens with more than one object.  5 text entry screens 
and three buttons tabs through all the entries, all the buttons, then 
the null object, and back to the first object.

So, does anyone know what I'm doing wrong, or how I can fix this?

    

Hello,

 I don't know if it will help you, but the API of gtk 2.* says (about 
gtk_window_set_default):
 
 Before making a widget the default widget, you must set the 
GTK_CAN_DEFAULT flag on the widget you'd like to make the default using 
GTK_WIDGET_SET_FLAGS().

As the API of this function is not documented for gtk 1.2, perhaps it is 
what is missing.

regards

Vincent TORRI
  
Hi,
    thanks for your response.

    Under GTK1.2 the button widget starts off with the flag set.  I did set it again, however, with

GTK_WIDGET_SET_FLAGS( button, GTK_CAN_DEFAULT );

    This had the strange effect of putting a 3 or so pixel border around the button after I then called gtk_window_set_default();

Just in case this helps anyone, I have this happening on the following systems:

SCO Openserver 5.0.5 with GTK+1.2.3 from Skunkware
SCO Openserver 5.0.5 with GTK+1.2.8 compiled from sources at Skunkware
Red Hat Linux 7.2 with GTK+1.2.10 installed from RPMS distributed with OS
Red Hat Linus 8.0 with GTK+1.2.10 installed from RPMS distributed with OS

    I found out that I wasn't compiling under 2.0 on Red Hat 8.0, it was picking up the 1.2.10 libraries and includes instead.  After forcing it to compile under GTK+2.0.6-8 as came with Red Hat 8.0 I found the problem was reduced.  Once the button had focus it would not leave the button.  When I added a second button, the focus swapped between the two.  It didn't want to focus by itself though, I had to call gtk_widget_grab_focus();

    I'm going to try to compile Gtk+2.0 for SCO, which is my target OS, but as Gtk+2.2.1 did not compile, I'm not going to hold my breath for 2.0.  SCO is missing XAddConnectionWatch and XProcessInternalConnection if anyone knows how to get around this...

Scott Burns


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