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

Re: How can I use the /multiple keyword with WIDGET_LIST



Nicholas Keat wrote:
> 
> I have created a widget based application for processing CT scanner
> image files that allows the user to select images from a list, and
> analyse them for certain image quality parameters.
> 
> What I would like to be able to do is to select, say, three images from
> a list of ten for analysis.  From the IDL documentation (ha!) it seems
> that I can use the '/multiple' keyword with widget_list to allow
> multiple selections, which it seems to do.  Running my app with a
> /multiple added to my widget_list statement allows me to press 'Shift'
> and 'Ctrl' to highlight more than one element on the list.  The problem
> is that the events generated by making multiple selections seem to be
> exactly the same as those created from making single selections.  How do
> I tell if the user has pressed 'Shift' or 'Ctrl' to make an extended
> selection?  Is it possible without extended hacks to track key presses?
> I've looked at the usual source of IDL explanations (www.dfanning.com)
> without finding any references...  Surely someone else must have had to
> do this before!
> 
> Nick
> --
> Nicholas Keat
> Senior Physicist - ImPACT Group, St George's Hospital
> London SW17 0QT
> Tel +44 (0)20 8725 3366       http://www.impactscan.org


hmmmm. If David comes over his hangover, he might be better suited to
answer this question. But as far as I can say, there is no need to
have different events. If you act on a "select" event, you would just
inquire about the currently selected items (Widget_Info) no matter if
any of these had been selected before or not. If you want to manage
your image display windows and only (re)display images that are
"freshly" selected, you will have to keep track of the selected images
yourself and store the previous selection somewhere -- a good place
seems the UValue field of the TLB widget (or for principalists, it's
first child).

Hope this helps,
Martin

-- 
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
[[ Dr. Martin Schultz   Max-Planck-Institut fuer Meteorologie    [[
[[                      Bundesstr. 55, 20146 Hamburg             [[
[[                      phone: +49 40 41173-308                  [[
[[                      fax:   +49 40 41173-298                  [[
[[ martin.schultz@dkrz.de                                        [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[