maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   python: TouchSelector forces to select at least one. (https://talk.maemo.org/showthread.php?t=72936)

laasonen 2011-05-10 19:06

python: TouchSelector forces to select at least one.
 
I can't figure out how to make TouchSelector which doesn't force you to select at least one option.

Little example I made:
Code:

import hildon, gtk

#Create window
dialog = gtk.Dialog()
dialog.connect('delete_event', gtk.main_quit)
#Create selector
selector = hildon.TouchSelector(text = True)
selector.set_column_selection_mode(hildon.TOUCH_SELECTOR_SELECTION_MODE_MULTIPLE)
for number in range(10):
        selector.append_text(str(number))
selector.select_iter(0, selector.get_model(0).get_iter(0), False)
#Create button
select = hildon.PickerButton(gtk.HILDON_SIZE_AUTO_WIDTH | gtk.HILDON_SIZE_FINGER_HEIGHT, hildon.BUTTON_ARRANGEMENT_VERTICAL)
select.set_title('Don\'t select anything!')
select.set_alignment(0,0,1,1)
select.set_selector(selector)
dialog.vbox.pack_start(select, False, False, 0)
#Draw
dialog.show_all()
gtk.main()

Thanks.

laasonen 2011-05-13 14:20

Re: python: TouchSelector forces to select at least one.
 
Anyone? This must be pretty simple, but I can't see it in documentations :o


All times are GMT. The time now is 09:07.

vBulletin® Version 3.8.8