How to exit a colorpicker? pls answer :((((((((((((((((((((((((((((((((((((

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By sterngames

why can’t i exit the color picker and press another button, normally?

:bust_in_silhouette: Reply From: Jayman2000

ColorPickers are more like scenes than they are like individual Nodes. I didn’t add any children to my ColorPicker, but it ended up giving itself a bunch of children at runtime:

ColorPicker
    HBoxContainer
        Control
        Control
    HBoxContainer
        TextureRect
        ToolButton
    VBoxContainer
    HSeparator
    VBoxContainer
        HBoxContainer
            Label
            HSlider
            SpinBox
                LineEdit
                    Timer
                    PopupMenu
                        Timer
                Timer
        HBoxContainer
            Label
            HSlider
            SpinBox
                LineEdit
                    Timer
                    PopupMenu
                        Timer
                Timer
        HBoxContainer
            Label
            HSlider
            SpinBox
                LineEdit
                    Timer
                    PopupMenu
                        Timer
                Timer
        HBoxContainer
            Label
            HSlider
            SpinBox
                LineEdit
                    Timer
                    PopupMenu
                        Timer
                Timer
        HBoxContainer
            CheckButton
            CheckButton
            Button
            LineEdit
                Timer
                PopupMenu
                    Timer
    HSeparator
    HBoxContainer
        TextureRect
    HBoxContainer
        Button

You must release focus from the child who has it, not from the ColorPicker itself. You can use this function to make sure that a Node and none of its children have focus:

func recursively_release_focus(node):
    if node is Control:
        node.release_focus()
    for child in node.get_children():
        recursively_release_focus(child)

what is, when you change the color, “the child who has it”

sterngames | 2021-03-14 12:20

It looks like the focus doesn’t change when you change the color. To figure this out, I added this to the ColorPicker’s parent:

func _physics_process(delta):
    print(get_focus_owner())

Jayman2000 | 2021-03-14 13:26

gives me the previous button i clicked (which is appearently, not a child of the color picker). so, why can’t i exit the color picker and press another button, normally?

sterngames | 2021-03-14 13:29