comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Displaying a list of filenames
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Displaying a list of filenames [message #78894 is a reply to message #78893] Tue, 03 January 2012 08:20 Go to previous messageGo to previous message
Doug Edmundson is currently offline  Doug Edmundson
Messages: 58
Registered: November 2005
Member
On 1/3/12 8:45 AM, Percy Pugwash wrote:
> On Jan 3, 3:11 pm, David Fanning<n...@dfanning.com> wrote:
>> Percy Pugwash writes:
>>> I would like to display a list of filenames in an widget application.
>>> I have so far been unable to find a satisfactory way of doing this,
>>> since I would like the user to be able to:
>>
>>> 1) Select one or several of the filenames in the list
>>> 2) View the whole filepath, right-aligned so that the name at the end
>>> is clear
>>
>>> I can't seem to right-align a list widget, and a text widget won't let
>>> me select an item in the list in a straightforward way. I think I can
>>> make it work with a table widget, but that seems to have irritating
>>> and unnecessary scroll bars.
>>
>>> Does anyone have a solution?
>>
>> My solution, after years of frustration trying to do just
>> this, was to retreat to a smarter version of Dialog_Pickfile,
>> which can remember the directory (and file, if I want) that
>> I previously selected. It's made my life easier and I no
>> longer wake up in terror at night thinking about table widgets. :-)
>>
>> http://www.idlcoyote.com/idldoc/cg/cgpickfile.html
>>
>> Cheers,
>>
>> David
>>
>> P.S. Set the MULTIPLE keyword if you want to select
>> multiple files.
>>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> David,
>
> Thanks very much. While I can see that cgPickfile offers some useful
> options not present in dialog_pickfile, I'm not sure if it's quite
> suitable for my purpose. The idea here is the the files have already
> been selected, and the selected files are displayed in a list of some
> kind, such that the user can highlight any given one of those files in
> order to tweak the processing steps for that file (with options given
> in the widget application). As such, I think it's quite important that
> the list would be embedded directly into the top-level base of the
> application. The files themselves might not all be in the same
> directory.
>
> Another slightly less satisfactory route I was considering exploring
> would be to use widget_list, but truncate the displayed paths so that
> the rightmost portion of the path is visible. However, this requires a
> way to calculate how much of the string will exactly fit in the
> available space. I suppose I could set the list to be a set width in
> characters, and then at least be sure that if I truncate each string
> to be equal to that width, they would fit in the box. I think it'd be
> quite unattractive though.
>
> P

Hi,

You should be able to use WIDGET_INFO( STRING_SIZE ) to compute the
string dimensions, in pixels. Find the longest string, set the widget
width, prepend with spaces, etc. Bit of a hack, but hope it works well.

Cheers,
Doug
Exelis VIS
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Displaying a list of filenames
Next Topic: running IDL as a 'sleeping' process

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 21:16:31 PDT 2025

Total time taken to generate the page: 1.28176 seconds