Comments (8)
I have also tried running the command with --features v4_10
and gotten the same result.
from gtk4-rs.
When I comment out these lines:
gtk4-rs/examples/squeezer_bin/main.rs
Lines 22 to 24 in 3826b9a
The window appears empty:
I am unsure if the squeezer
(SqueezerBin::default()
) is not mounting or if its child (Some(>k::Label::new(Some("Hello World!")))
) is not mounting. I'm pretty new to GTK, so I'm unsure how to debug this.
from gtk4-rs.
Setting GTK_DEBUG=all
lets me run the program with an interactive debugging window, and I can see the GtkLabel object with the value "Hello World!" that is a child of the SqueezerBin object.
Further reading: Running and debugging GTK Applications
from gtk4-rs.
Not sure if this is relevant, but it looks like the property GtkPicture:keep-aspect-ratio was deprecated in GTK 4.8 in favor of the new property GtkPicture:content-fit.
I do not see either of those properties documented on GtkWidget.
It makes sense to me that we are trying to define this as a custom property on SqueezerBin
, but I am not sure where we are going wrong.
from gtk4-rs.
I believe I have identified the reason the GtkLabel is not visible even when disabling the code that is causing errors...
SqueezerBin::size_allocate()
has a mistake:
When we call child_size
, we should be passing &child
, not &*widget
:
@@ -52,7 +52,7 @@ impl WidgetImpl for SqueezerBin {
fn size_allocate(&self, width: i32, height: i32, baseline: i32) {
let widget = self.obj();
if let Some(child) = widget.child() {
- let ((_, horizontal_size), (_, vertical_size)) = child_size(&*widget);
+ let ((_, horizontal_size), (_, vertical_size)) = child_size(&child);
let (mut horizontal_zoom, mut vertical_zoom) = (
width as f32 / horizontal_size as f32,
from gtk4-rs.
I will have a look in a bit
from gtk4-rs.
It was fixed by #1760
from gtk4-rs.
No it wasn't actually
from gtk4-rs.
Related Issues (20)
- Chapter 9 missing derived_properties and subclassing
- Fuzzy font on Windows HOT 1
- gtk::DragIcon::for_drag returns Widget, not DragIcon HOT 5
- glib::Regex forced main thread to panic at the end of while loop HOT 1
- custom_orientable example emits critical warning when run
- No method named `dispose_template` found for reference `&custom_buildable::imp::CustomBuildable` in the current scope HOT 3
- Is it possible to improve compile times? HOT 1
- Compiler error when using `enum` subclasses of Object as properties HOT 1
- CSS opacity not respected for window HOT 1
- Accessing GtkWidget class methods HOT 1
- Support for dark mode HOT 1
- Book: Issue with glib::spawn_future_local in gtk-rs Chapter 6 HOT 5
- [BOOK] Chapter 15 should have adwaita-icon-theme included in macOS install command HOT 1
- Should connect_unrealize and connect_destroy be FnOnce() rather than Fn()? HOT 1
- Segfault if trying to use certain builders before GTK is initialized
- [HELP] /usr/bin/ld: cannot find -lgtk-4 HOT 1
- [HELP] Can't get the default Display. HOT 1
- [HELP] Examples to use `block_signal` and `unblock_signal`
- [HELP] Segmentation fault while attaching tab to gtk::Notebook HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtk4-rs.