yab | yet another Basic for HAIKU
transparency error in yab - Printable Version

+- yab | yet another Basic for HAIKU (https://yab.orgfree.com/forum)
+-- Forum: installing / troubleshooting / feature requests (https://yab.orgfree.com/forum/forumdisplay.php?fid=5)
+--- Forum: feature requests / bug fixes (https://yab.orgfree.com/forum/forumdisplay.php?fid=11)
+--- Thread: transparency error in yab (/showthread.php?tid=78)



transparency error in yab - lelldorin - 12-23-2016

www.lelldorin.de/screens/yab_tranparency_error.png

If i use buttons with transparency pictures and change then the background color the image of the button does not any more transparent.


RE: transparency error in yab - bbjimmy - 12-24-2016

Please show the code that caused this problem.


RE: transparency error in yab - lelldorin - 12-24-2016

(12-24-2016, 12:13 AM)bbjimmy Wrote: Please show the code that caused this problem.

Why? It is only a image button and i use for the image button a picture (gif) with transparent color. It is not a special code or somethign like this.


RE: transparency error in yab - bbjimmy - 07-07-2017

It seems that the background color for the image is set when the button is added. to work around this, when the background color is changed, re-add the button image. Since the button has the same name it seems to work just fine:

Code:
#!yab

doc Place a description of your
doc program here.
doc
doc Author, date, license

// set DEBUG = 1 to print out all messages on the console
DEBUG = 1
settingsdir$="/boot/home/config/settings/"

OpenWindow()

// Main Message Loop
dim msg$(1)
while(not leavingLoop)
    nCommands = token(message$, msg$(), "|")

    for everyCommand = 1 to nCommands
        if(DEBUG and msg$(everyCommand)<>"") print msg$(everyCommand)

        switch(msg$(everyCommand))
            case "_QuitRequested"
            case "MainWindow:_QuitRequested"
                leavingLoop = true
                break
            case "test"
            t=t+1
            if t=1 then
            DRAW SET "BGColor", 100,110,110, "mainview"
            else
            DRAW SET "BGColor", 100,155,155, "mainview"
            t=0
            endif
            button image 25, 25, "test", settingsdir$+"test_pressed.png", settingsdir$+"test.png", "", "mainview"
            break
            
            default
                
        end switch

    next everyCommand


wend

CloseWindow()

end


// Setup the main window here
sub OpenWindow()
    window open 100,100 to 600,500, "MainWindow", "Main Window"
    view 0,0 to 500,400, "mainview" ,"MainWindow"
    DRAW SET "BGColor", 100,155,155, "mainview"
    button image 25, 25, "test", settingsdir$+"test_pressed.png", settingsdir$+"test.png", "", "mainview"

    
end sub

// Close down the main window
sub CloseWindow()
    window close "MainWindow"
    return
end sub



Free Web Hosting