B4J Question Force redraw?

Blueforcer

Well-Known Member
Licensed User
Longtime User
I have a problem in my crossplatform app.
In the initialize sub of each b4xpage and other customviewsi set the colors in the Initializesub.
but It seems that some colors are not updated.
But if i open a B4XDialog without doing anything, the colors updates instantly.This only happens in B4J. No Problem in B4A.
There is nothing wich could stop the UI thread.
testet in debug and release mode.

themes.gif



what am i missing here?
 

Blueforcer

Well-Known Member
Licensed User
Longtime User
What are we seeing in the screen capture?

Resizing a panel will cause it to redraw. You can make it 1 pixel wider + sleep(0) + remove the additional pixel.
You see that for example in the sidebar some colors are missing and a lot of white around the sidebar items. (just marked it yellow)
As soon as I open the b4Xlistteplate all colors appear instantly.

1645955056667.png


Does the b4xdialog resize the panel?


I tried the one pixel rezize in the B4XPage_Appear sub,. Colors still missing.
The only way to apply all previously set colors is to open the b4xdialog for whatever reason xD
And it applied BEFORE i select anyting from the list. so just opening the dialog is enough

B4X:
#if b4j
Private Sub ThemeLabel_MouseClicked (EventData As MouseEvent)
#else
Private Sub ThemeLabel_Click
#End If
    Dim Dialog As B4XDialog
    Dialog.Initialize(Root)
    Dim options As B4XListTemplate
    options.Initialize
    options.Options = Array As String("Oceanic","Darker","Lighter","Palenight","DeepOcean","Forest","SykBlue","SandyBeach","Volcano","Monokai","Dracula","Github","GithubDark","ArcDark","OneDark","OneLight","SolarizedDark","SolarizedLight","NightOwl","LightOwl","Moonlight","Synthwave84")
    Wait For (Dialog.ShowTemplate(options, "OK", "", "CANCEL")) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        Theme.setTheme(options.SelectedItem)
    End If
End Sub
 
Last edited:
Upvote 0
Top