yab | yet another Basic for HAIKU

Full Version: Resolved tabview bug
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.

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]
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
    msg$ = message$
    if (split(msg$, part$(), ":|") > 2) then
        PartTwo$ = part$(2)
        PartThree$ = part$(3)
    if (split(msg$, part$(), ":|") > 3) then
        PartFour$ = part$(4)

    if (msg$ <> "")  print msg$
    switch msg$
    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"

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

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

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

[Image: bottomtabs.png]
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.
The issue has been resolved.


Many Thanks to KapiX, Kacper Kasper for all the help.
Free Web Hosting