Welcome, Guest. Please login or register.

Author Topic: MUI listview help needed  (Read 2843 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
MUI listview help needed
« on: April 25, 2003, 01:18:28 PM »
I'm using MUIM_List_InsertSingle in a loop to write a list of stuff from a text file to a list view. It's just a one column no frills listview. I can see my new entries as its being added, but when its finished, if I try to select one, or scroll up and down the listview, the entries disapear. But the scrollbars stay small, as if there is something there.  If I use the redraw command, everything disappears. If I use the MUIA_List_Quiet option, then it wont show the entries at all, even after setting it to FALSE and trying Redraw again..

Anyone think they know whats wrong?
 

Offline blubbe

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 268
    • Show only replies by blubbe
    • http://somewhere.in-hell.com
Re: MUI listview help needed
« Reply #1 on: April 25, 2003, 01:51:55 PM »
Im guessing you have no construct/destruct hooks.
In this case you need to tell the listview to use
the built in ones:
MUIA_List_ConstructHook,
MUIV_List_ConstructHook_String,
MUIA_List_DestructHook,
MUIV_List_DestructHook_String

The built in one makes  internal copies
of the strings so they dont dissapear.
i      i     i    i   i  i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i  i   i    i     i     i      i
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: MUI listview help needed
« Reply #2 on: April 25, 2003, 02:04:05 PM »
Tried adding that, construct and destruct hooks... didnt affect the program.

Any other ideas? :)
 

Offline blubbe

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 268
    • Show only replies by blubbe
    • http://somewhere.in-hell.com
Re: MUI listview help needed
« Reply #3 on: April 25, 2003, 04:55:14 PM »
Do you use a display-hook ?, in that
case the error could be there. Otherwise
paste a snippet of the code here and im sure me or someone will find what is wrong.
 
i      i     i    i   i  i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i  i   i    i     i     i      i
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: MUI listview help needed
« Reply #4 on: April 26, 2003, 01:27:58 AM »
Here are the two important snippets from my program..

   Object->LV_avail_binary_ng = ListviewObject,
        MUIA_HelpNode, "LV_avail_binary_ng",
        MUIA_List_ConstructHook,MUIV_List_ConstructHook_String,
        MUIA_List_DestructHook,MUIV_List_DestructHook_String,
        MUIA_FrameTitle, "Available Binaries",
        MUIA_Listview_MultiSelect, MUIV_Listview_MultiSelect_Default,
        MUIA_Listview_List, Object->LV_avail_binary_ng,
    End;


nl_file.open ("progdir:a.txt",ifstream::in);
set2(app->LV_avail_binary_ng,MUIA_List_Quiet,TRUE);
while(nl_file.getline(ng2insert, 80, '\n'))
{
   DoMethod(app->LV_avail_binary_ng, MUIM_List_InsertSingle, ng2insert, MUIV_List_Insert_Bottom);
}
set2(app->LV_avail_binary_ng,MUIA_List_Quiet,FALSE);
nl_file.close();

DoMethod(app->LV_avail_binary_ng,MUIM_List_Redraw,MUIV_List_Redraw_All);
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show only replies by jahc
    • http://wookiechat.amigarevolution.com
Re: MUI listview help needed
« Reply #5 on: April 26, 2003, 01:44:18 AM »
Problem solved.

It WAS the destruct/construct hooks.. I was trying to add those hooks to the Listview object, instead of the List object. Duh!! :) Thanks for your help.

    Object->LV_avail_binary_ng = ListObject,
        MUIA_Frame, MUIV_Frame_String,
              MUIA_List_ConstructHook,MUIV_List_ConstructHook_String,
        MUIA_List_DestructHook,MUIV_List_DestructHook_String,
    End;

    Object->LV_avail_binary_ng = ListviewObject,
        MUIA_HelpNode, "LV_avail_binary_ng",
        //MUIA_List_ConstructHook,MUIV_List_ConstructHook_String,
        //MUIA_List_DestructHook,MUIV_List_DestructHook_String,
        MUIA_FrameTitle, "Available Binary Newsgroups",
        MUIA_Listview_MultiSelect, MUIV_Listview_MultiSelect_Default,
        MUIA_Listview_List, Object->LV_avail_binary_ng,
    End;

There, that works much better.
 

Offline blubbe

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 268
    • Show only replies by blubbe
    • http://somewhere.in-hell.com
Re: MUI listview help needed
« Reply #6 on: April 26, 2003, 12:40:22 PM »
Yep, thats it :)
i      i     i    i   i  i iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii i  i   i    i     i     i      i