#!/bin/sh

GTKDIALOG=gtkdialog

list() {
  ls -lha | grep ^d | awk '{print "dir_o|" $1 "|" $8}'
  ls -lha | grep ^- | awk '{print "gexec|" $1 "|" $8}'
}; export -f list

export MAIN_DIALOG='
<vbox>
  <tree>
    <label>Permissions|Filename</label>
    <variable>TREE1</variable>
    <width>400</width><height>150</height>
    <input icon-column="0">list</input>
  </tree>
  <hseparator></hseparator>
  <tree stock-id="gtk-file">
    <label>Icon Name|Permissions|Filename</label>
    <variable>TREE2</variable>
    <height>150</height><width>400</width>
    <input>list</input>
  </tree>
  <hseparator></hseparator>
  <tree>
    <variable>TREE3</variable>
    <width>400</width><height>150</height>
    <label>Device                           | Directory | File</label>
    <item stock-id="gtk-floppy">Floppy Disk | /floppy/  | ak.tex</item>
    <item stock-id="gtk-floppy">Floppy Disk | /floppy/  | ak.dvi</item>
    <item stock-id="gtk-floppy">Floppy Disk | /floppy/  | ak.ps</item>
    <item stock-id="gtk-floppy">Floppy Disk | /floppy/  | ak.pdf</item>
    <item stock-id="gtk-cdrom">CD_ROM Drive | /cdrom/   | </item>
  </tree>
  <hseparator></hseparator>
  <hbox homogeneous="true">
    <button ok></button>
  </hbox>
</vbox>
'

$GTKDIALOG --program=MAIN_DIALOG 
