Page 1 of 1

Is it possible to prevent ListViewGadget Scrolling?

Posted: Sun Mar 12, 2023 1:59 pm
by HarrysLad
With the ListViewGadget, is it possible to prevent horizontal scrolling?
I know how to hide the scrollbar but it's all too easy to inadvertently scroll sideways with a trackpad or Magic Mouse and this gives me problems when displaying a table.

Dave

Re: Is it possible to prevent ListViewGadget Scrolling?

Posted: Mon Mar 13, 2023 6:02 am
by wombats
This seems to work:

Code: Select all

If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ListViewGadget(0, 10, 10, 250, 120)
  For a = 1 To 12
    AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview")
  Next
  SetGadgetState(0, 9)
  CocoaMessage(0, GadgetID(0), "sizeToFit")
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

Re: Is it possible to prevent ListViewGadget Scrolling?

Posted: Tue Mar 14, 2023 8:28 am
by HarrysLad
Many thanks wombats. That works for me. :D

Dave