Re: Problem with Tabs



On Mon, 2003-03-03 at 01:27, Scott Burns wrote:
Hi,
    just a quick note to say I found a soloution.  Unfortunately, it 
required a change to the code behind the gtkwindow.

    What was happening was that when moving through the list of items, 
forwards or backwards, it would order the list of widgets accordingly 
and set the focus to the next in the list.  When it was moving back from 
the first or forwards from the last it would no find the appropriate 
next item because it wouldn't wrap.  It would fall back and try to focus 
the default object, which seemed to be null in some of my code, and the 
first item in others.  The lead to nothing being made active up until 
this morning, and the first item in the list being half activated since 
then.

    I changed the code so that if it failed to find the next item it 
would run the function again.  Because the current item in focus was 
null (not yet having been set to the default ) it would select the first 
item it came across.  Because the list was sorted according to how I was 
moving it selected the correct item.

    The function in gtkwindow.c I changed was 
gtk_window_key_press_event(), and I changed it to call 
gtk_container_focus() twice if it failed the first time.

    Anyone know of a better way to have done this?

 * Can't help with GTK+-1.2 ... focus was a little wonky there,
   lots of work done in that area in the last four years.

 * If you can reproduce problem with focus with current versions
   of GTK+, please file a bug in bugzilla, preferrably with a small
   standalone test case.

Thanks,
                                            Owen





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