beeware / beeware/toga

Style visibility=HIDDEN has no effect on GTK

Open
#2,447 1 comment 0 reactions 0 assignees View on GitHub
bug gtk linux
Dominant language
Python
Stars
5.4k
Forks
827
Avg merge
15h 39m
Merged PRs (30d)
40

Description

### Describe the bug

Using this code:
```
self.sel_control = toga.Selection(
items=[], style=tp.Pack(flex=1), accessor="name",
on_change=self.on_selection_control_sel_changed)
box.add(self.sel_control)
self.sel_control.style.update(visibility=toga.style.pack.HIDDEN)
```
The widget is still visible. Makes it impossible to have a box with different widgets showing only the one matching an input type. And no the OptionContainer is not an option since it has tabs and does not guarantee invisibility.

### Steps to reproduce

Use the code above. Widget is still visible

### Expected behavior

Widget is invisible

### Screenshots

_No response_

### Environment

Linux, most recent Toga

### Logs

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided Selection example on Linux with the GTK backend, then trace how the visibility style is applied to the widget. Done means setting visibility to HIDDEN makes the widget invisible while preserving the expected behavior of other visibility values.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.