• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Adding image backgroud to gtk 3 window hiding widgets and layouts

Resolved: Adding image backgroud to gtk 3 window hiding widgets and layouts

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I have created the GTK 3 window with multiple layouts, each contain some widgets on top of the main layout. Now I tried to add image background to the window. But the image is hiding all other layouts and widgets that exist in the main layout.
I have tested the same code in GTK 2, It is working as expected. (i.e) child layouts and widgets are showing on top of the pixmap.
Here is the code that I have tried.

Answer:

It seems the philosophy of GTK3 is to steer more widget size/image/display functionality towards using CSS. With that in mind, I took your program and added a CSS provider widget to your program.
I then deactivated the section that places your pixel image inside the window.
Then after the window widget had been defined, I defined the CSS style information for the provider and then associated the provider with the window widget.
Once the program was built, the various widgets appeared within the window.
Sample Window
So you might have to utilize CSS providers more in order to replicate the background behavior in GTK2.
Hope that helps.
Regards.

If you have better answer, please add a comment about this, thank you!

gtk gtk2 gtk3 gtkmm
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: std::regex_replace to replace multiple combinations

26/03/2023

Resolved: How can I copy files using the ansible.builtin.copy module and avoid conflicting file names?

26/03/2023

Resolved: Reshape tensors of unknown shape with tf.function

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.