Lines Matching +full:user +full:- +full:selected

18 # Then, methods can be called on it for interacting with the user.
20 # I wrote this because I want to use my 486-33 laptop as my main
22 # user in console mode. There are apparently other modules out there
28 # *any* objects to be displayed and selected, not just strings.
35 # (it's possible -- I've already tried :-).
37 # height and width defaults. Hmmm - should also then check for
39 # Put into a package name to make more reusable - reduce the possibility
43 # there is a bug in (at least) Linux-Mandrake 7.0 Russian Edition
44 # running on AMD K6-2 3D that causes core dump when 'dialog'
45 # is running with --gauge option;
51 # - 'gauge' widget *)
52 # - 'title' option to some widgets
53 # - 'checked' option to checklist dialog; clicking "Cancel" is now
55 # - 'selected' option to radiolist dialog; clicking "Cancel" is now
57 # - some other cosmetic changes and improvements
78 self.__bgTitle = '--backtitle "%s"' % text
93 """Call dialog w/out passing any more options. Needed by --clear."""
101 return '--title "%s" ' % title
106 Put a Yes/No question to the user.
107 Uses the dialog --yesno option.
111 '--yesno "%s" %d %d' % (text, height, width))
117 Pop up a message to the user which has to be clicked
121 '--msgbox "%s" %d %d' % (text, height, width))
125 """Make a message to the user, and return immediately."""
126 self.__perform('--infobox "%s" %d %d' % (text, height, width))
131 Request a line of input from the user.
132 Returns the user's input or None if cancel was chosen.
135 '--inputbox "%s" %d %d "%s"' % (text, height, width, init))
150 ' --textbox "%s" %d %d' % (filename, height, width))
155 Display a menu of options to the user. This method simplifies the
156 --menu option of dialog, which allows for complex arguments. This
159 The selected object is returned, or None if the dialog was canceled.
161 menuheight = height - 8
164 (code, output) = self.__perform('--menu "%s" %d %d %d %s' %\
167 return list[int(output[0]) - 1]
174 Returns a list of the selected objects.
175 Returns an empty list if nothing was selected.
177 checked -- a list of boolean (0/1) values; len(checked) must equal
182 menuheight = height - 8
188 (c, o) = self.__perform('--checklist "%s" %d %d %d %s' %\
192 indexList = map(lambda x: int(x[1:-1]), split(output))
198 if c == 0: # Nothing was selected
203 def radiolist(self, text, height=15, width=54, list=[], selected=0): argument
205 Return the selected object.
206 Returns empty string if no choice was selected.
208 selected -- the selected item (must be between 1 and len(list)
211 menuheight = height - 8
214 if selected:
215 i, item, tmp = triples[selected - 1]
216 triples[selected - 1] = (i, item, 'on')
219 (c, o) = self.__perform('--radiolist "%s" %d %d %d %s' %\
222 return list[int(o[0]) - 1]
231 Clear the screen. Equivalent to the dialog --clear option.
233 self.__perform_no_options('--clear')
241 --textbox.
248 '--textbox "%s" %d %d' % (fName, height, width))
262 d.stop_gauge() # clean-up actions
265 '--gauge "%s" %d %d %d' % (text, height, width, perc)
324 "Sun-dried tomatoes"], checked=[0,0,0,1,1,1])
328 "Peanut Butter and Jelly", "Grilled cheese"], selected=4)