Resolved 1.7.5.5 tabview bug
#1
On the current build of yab is a Tabview error.

I create a test app to check a bug reported by bbjimmy and thaflo. Here the tabview crashed then you browsing over the view after removing the tabview with VIEW REMOVE.

I does not have this problem on my system, but i see another one. In my test app i create a tabview with two tabs. on the first one i place a button.

Then i remove the view and create the tabviews again. Here is the button not on the first, it is on the second tab.

https://codeshare.io/al9NJY
Reply
#2
I have not been able to get tabview working as it should. I guess my c++ and understanding of the tabview code in Haiku isn't good enough.

As a work-around, I have am making a tabview in yab as a library. I have tested it in your code as a replacement for yabs built-in tabview and it seems to be working.

[Image: tabtest.png]
Code:
screenWidth = peek("desktopwidth")
screenHeight = peek("desktopheight")
import yabtab


window open screenWidth/2-200, screenHeight/2-200 to screenWidth/2+200, screenHeight/2+200, "MainWindow", "Test"

    VIEW 0,0 TO 400,320, "BackgroundView","MainWindow"
    x=yabtab( 5,2 , 395,300,"Test","top","BackgroundView")
    //TABVIEW 5,2 TO 395,300, "Test", "top", "BackgroundView"
        view$=tabadd$("Test", "Tab1")
        //TABVIEW ADD "Test",  "Tab1"
            BUTTON 5,5 TO 105,25, "BT:Hui", "Hui",view$
        view1$=tabadd$("Test", "Tab2")
        //TABVIEW ADD "Test",  "Tab2"
        
        

    BUTTON 5,350 TO 100,375, "BT:Remove", "Remove", "MainWindow"
    BUTTON 105,350 TO 200,375, "BT:Add", "Add", "MainWindow"

dim part$(1)

inloop = true
while(inloop)
    msg$ = message$
    
    if (split(msg$, part$(), ":|") > 2) then
        PartOne$=part$(1)
        PartTwo$ = part$(2)
        PartThree$ = part$(3)
    fi
    
    if (split(msg$, part$(), ":|") > 3) then
        PartFour$ = part$(4)
    fi

    if (msg$ <> "")  print msg$
    switch msg$
    
    //Cases
    
    case "BT:Add|"
        //VIEW 0,0 TO 400,320, "BackgroundView","MainWindow"
        x=yabtab( 5,2 , 395,300,"Test","top","BackgroundView")
    //TABVIEW 5,2 TO 395,300, "Test", "top", "BackgroundView"
        view$=tabadd$("Test", "Tab1")
        //TABVIEW ADD "Test",  "Tab1"
            BUTTON 5,5 TO 105,25, "BT:Hui", "Hui",view$
        view1$=tabadd$("Test", "Tab2")
        //TABVIEW ADD "Test",  "Tab2"
        
            
        break

    case "BT:Remove|"
        //VIEW REMOVE "BackgroundView"
         if VIEW GET "containerTest","exists" yabtabremove("Test")
        break
    
    case "MainWindow:_QuitRequested|"
        WINDOW CLOSE "MainWindow"
        break


    default:
    
    end switch
    
    if VIEW GET "containerTest","exists" checktabclick()        
    if(window count<1) inloop = false
    sleep 0.1    
    wend

So far the only option is top, and the library needs to be reformatted to remove all my troubleshooting stuff, but it works!
Reply
#3
I now have the library working with bottom tabs:

[Image: bottomtabs.png]
Reply
#4
I have a working yabtab.yab library. The attatched zip includes the library, images used to create the tabs, and a test program to demonstrate the use.


Attached Files
.zip   yabtablibrary.zip (Size: 11.18 KB / Downloads: 0)
Reply
#5
Getting some new info from KapiX... https://github.com/bbjimmy/YAB/pull/6#is...-381464218 and https://www.freelists.org/post/haiku-dev...g-BTabView
Reply
#6
The issue has been resolved.

https://github.com/bbjimmy/YAB/commit/44...15645a3cb4

Many Thanks to KapiX, Kacper Kasper for all the help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)
Free Web Hosting