Amiga-C (208/223)

From:Donald W Millican
Date:29 Aug 2001 at 22:33:00
Subject:[amiga-c] MUI Listviews

Hello,

A couple of questions :

Q1.
I've got a problem with an MUI listview gadget in my application. The
application has four lists which are displayed according to user
choice. One of the lists is wider than the others but they are all
longer than it is. When the application opens, list1 is in the
Listview gadget :

// Listview gadget
Child, list = ListviewObject,
MUIA_Listview_List, ListObject, InputListFrame,
MUIA_List_AdjustHeight, TRUE,
MUIA_List_AdjustWidth, TRUE,
End,
End,

// Set list gadget contents
DoMethod(list,MUIM_List_Insert,names1,-1,MUIV_List_Insert_Top);

When the user chooses a different list the Listview gadget is cleared
and re-filled :

DoMethod(list,MUIM_List_Clear);
DoMethod(list,MUIM_List_Insert,names4,-1,MUIV_List_Insert_Top);

In this example it is filled with list4 (the widest list).

The new list appears in the gadget but the gadget does not adapt to
the new dimensions of the list and as the new list is wider than the
old one some of the text on the right hand side is not seen. One
rather drastic way to solve the problem is to close then re-open the
window forcing all the gadgets to adjust to the size of their contents

set(window,MUIA_Window_Open,FALSE);
set(window,MUIA_Window_Open,TRUE);

but doing this causes an annoying blink on the screen.

Is there any way of getting the Listview gadget to resize itself when
its contents are changed without an annoying blink?

Q2.
I want to set the first item in the above listview to be selected at
program start and be able to reset this when the listview contents
change. The MUI autodocs say I should :

DoMethod(list,MUIA_List_Active,MUIV_Active_List_Top);

but whether I do that during gadget creation, after setting the list
contents or indeed after opening the window, nothing ever gets
selected.
In GadTools when the program is run the first item in a listview is
automatically selected and I want the same thing to happen here.

What am I doing wrong?

Thanks,

Donald



Member of GAUG
Glasgow Amiga Users Group
*-Join our mailing list-*
gaug-subscribe@onelist.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Secure your servers with 128-bit SSL encryption! Grab your copy of VeriSign's FREE Guide: "Securing Your Web Site for Business." Get it Now!
http://us.click.yahoo.com/n7RbFC/zhwCAA/yigFAA/dpFolB/TM
---------------------------------------------------------------------~->

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/