• Can anyone tell me why the code below doesn't work?

    From David Linda@21:1/5 to All on Thu Dec 15 10:01:19 2022
    I placed the code below in the activate event of a datawindow and I could see no listbox. Then I put the code in the click event of a pushbutton and still no listbox.

    local oDim := Dimension {0,0,200,200}
    local oList := ListBox{self, 99, Point{10,10},oDim}

    oList:Show(SHOWNORMAL)

    Thanks,

    Dsvid

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JohnMartens@21:1/5 to All on Thu Dec 15 20:11:22 2022
    I've got no idea why it did not work.

    Is it possible to put the listview on the data window with the Window
    designer, hide is in the postinit and show() it in the case of the event ?

    John


    Op 15-12-2022 om 19:01 schreef David Linda:
    I placed the code below in the activate event of a datawindow and I could see no listbox. Then I put the code in the click event of a pushbutton and still no listbox.

    local oDim := Dimension {0,0,200,200}
    local oList := ListBox{self, 99, Point{10,10},oDim}

    oList:Show(SHOWNORMAL)

    Thanks,

    Dsvid



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From [email protected]@21:1/5 to All on Thu Dec 15 12:04:33 2022
    try
    local oDim := Dimension {200,200}

    J.S


    Dňa štvrtok 15. decembra 2022 o 19:01:20 UTC+1 používateľ [email protected] napísal:
    I placed the code below in the activate event of a datawindow and I could see no listbox. Then I put the code in the click event of a pushbutton and still no listbox.

    local oDim := Dimension {0,0,200,200}
    local oList := ListBox{self, 99, Point{10,10},oDim}

    oList:Show(SHOWNORMAL)

    Thanks,

    Dsvid

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From dlzc@21:1/5 to [email protected] on Fri Dec 16 08:14:14 2022
    On Thursday, December 15, 2022 at 11:01:20 AM UTC-7, [email protected] wrote:
    I placed the code below in the activate event of a datawindow
    and I could see no listbox. Then I put the code in the click event
    of a pushbutton and still no listbox.

    local oDim := Dimension {0,0,200,200}

    Illegal index, don't believe you can have "0" as an array index. {1,1,200,200} might work, or at least not throw an error.

    local oList := ListBox{self, 99, Point{10,10},oDim}

    oList:Show(SHOWNORMAL)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jamal@21:1/5 to David Linda on Fri Dec 16 15:58:17 2022
    David,

    The problem is that you are not using the Dimension class correctly.
    This class has only 2 arguments, not 4. Your passing 0 for nWidth and
    nHeight for the first two arguments, effectively making the ListBox
    control invisible:

    Here is the class definition
    Dimension{[<nWidth>], [<nHeight>]}

    So, change your code to:

    local oDim := Dimension {200,200}
    local oList := ListBox{self, 99, Point{10,10}, oDim}

    oList:Show(SHOWNORMAL)


    IMPORTANT: you are declaring a local oList variable. This should be a
    PROTECT oList as ListBox at the window class level so can access it
    later on.

    Jamal

    On 12/15/2022 1:01 PM, David Linda wrote:
    I placed the code below in the activate event of a datawindow and I could see no listbox. Then I put the code in the click event of a pushbutton and still no listbox.

    local oDim := Dimension {0,0,200,200}
    local oList := ListBox{self, 99, Point{10,10},oDim}

    oList:Show(SHOWNORMAL)

    Thanks,

    Dsvid



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)