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

[MacPerl] modification of dialogs



Can someone help me with that one?

As an exercise to become familar with MacPerl again after a pause of
about 2 years, I started a sort of poor man's database based on text
files. Now I would like to offer a search dialog presenting the user a
couple of text fields which allow him to specify which entries he is
interested in and which he may like to modify. When the user clicks OK,
the script evaluates the entries in each field (they may also be empty)
and looks for matching entries in a hash of hashes containing the data.
It stores them in a temporary HoH. And now my problem:

The search dialog is created as usal with MacDialog->new as usual. If
there are matching entries, I would like to 

- change the title of the dialog window, 
- change the text of the OK-Button, 
- add 4 Buttons in case more than one entry is found (a first, previous,
next and last button), let the user look at and modify the matching
entries and finally discard or save the changes.

I haven't found a command for the first problem and apparently used the
wrong command (SetDialogItemText ($dlg->window(), 2, 'Change');) for the
second problem (flickering of the button was the only result I got). 

With respect to the third problem, I tried 
    $first = [kButtonDialogItem(), Rect->new(10, 325, 50, 345), '|<-'];
    $dlg->MacDialogItems::add_item($first);
    $dlg->item_hit (19 => \&First);
(for the other buttons as well). Syntax checks gave ok. When running the
script, I got a "reference not an ARRAY" message. I tried a few
varieties, based on my guesses what arguments the routine add_item might
expect. I must confess that I am very much lost when I try to understand
what the routines in e.g. Dialogs.pm mean and do and what the correct
syntax may be, although I have obtained "MacPerl: Power and ease" and
quite a few code examples.

Maybe I should take another approach and destroy the search dialog
building a completely new one. Or is there an even better way to present
the user with a couple of matching entries?

Thanks a lot for any comments,

Florian

----------------------------------------------------------------------
- Dr. F. Colbatzky          Dept. of Non-clinical Drug Safety        -
- Tel. +49 (7351) 547237    Boehringer Ingelheim Pharma KG, Biberach -
- Fax  +49 (7351) 542183    D-88397 Biberach/Riss                    -


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch