[Urwid] radio button magic

Ian Ward ian at excess.org
Sun Jul 23 19:21:00 EDT 2006


Eric S. Johansson wrote:

> the current quandary is after I select a radio button, the cursor moves 
> back to the green radio button no matter which radio button I select. 
> How I get the cursor to stay in the same position as the radio button 
> selection or maybe I should say forced reselection.
> 

If you are using a GridFlow or Columns widget to arrange the radio 
buttons you can call its set_focus method to restore the focus to the 
correct radio button after you recreate the group of radio buttons.

Alternatively you can avoid recreating the radio button group every time 
one of its items is selected. If you want help with that please post 
some code we can run (without downloading extra libraries).

Ian




More information about the Urwid mailing list