Strange issue when I using GtkScrolledWindow in glade - drag-and-drop

I want to wrap a listbox widget into a scrolled widget, then I find the GtkScrolledWindow, however, I could not drag and drop a GtkListBox into GtkScrolledWindow. I also tried right click the GtkListBox, select Add Parent then Scrolled Window like the following snapshot.
But, I could make it work by manual modify the glade ui file.
So I want to know Why and How to do it in glade.

José Fonte's answer is right, I need to wrap the content into a viewport first, then make the viewport as a child of scrolledWindow.

Related

How to use SizeTransition with Text inside a Row without overflows

Problem summary
I'm building simple animation in which, simply, a panel expands to the right on a onTap event. The layout can be summarized as follows:
The panel has many tiles. Each tile has its own:
leading icon
title text
trailing icon
Each tile, when expanded, shows the three widgets above
Each tile, when shrinked, just shows the leading icon
The panel is scrollable to hold many icons such as these
At the end of the panel there's a simple icon which, when tapped, triggers the "expand" or "shrink" animation
The animation is built with an AnimatedContainer on the panel and a SizeTransition on the single tiles (via one single controller on the parent class)
The problem is simple: when the tiles shrink, their inner text overflows in the row.
Sample code
I just made this reproducible example on DartPad.
The obvious solution isn't helping me out
The most obvious solution is to simply wrap the Text inside a Flexible Widget: this advised by Flutter's docs and it makes sense, but unluckily it completely breaks my Layout.
Flexible introduces a flex factor that in this context is 100% unwanted.
I want my leading icons to be always at the end of the row, so my Spacer widget should "prevail" there.
I can't just play with flex factors there, as it would unintendedly hide text depending on its value.
Another code smell
Another thing I really don't like is the fact that I have to build a controller on the parent class, but I'm not actually using it on the parent class (I'm just exploiting it so I can give it to the children).
I'm new to animations in Flutter so I'm kinda confused on how I should orchestrate the whole thing here.
Any help will be appreciated / upvoted / accepted. Thank you!
As far as I understood you in a right way you just need set sizes for Row inside of SizeTransition instead of Container sizes
Here is your modified sample https://dartpad.dev/?id=a2408d29a1e8c6ce7a1cef8f21e7491d
I'd try an OverflowBox or a FittedBox (wrapping your text), depending on the result you want to achieve.

Flutter: SingleChildScrollView is not able to scroll to bottom within Expanded

I have programmed a modal buttom sheet which with this package (using a showCupertinoModalBottomSheet). This modal has a "header" which shows the heading and a close button on the left so the user knows what the modal is about and has a "footer" with two buttons to either apply the filter or reset it.
Between the header and the footer is a a Expanded component with a SingleChildScrollView inside in order to scroll inside the modal. This is needed because there are more filter options available than space! I am very happy that I found a solution without a SizedBox component which has a given height because the height of smartphones vary.
However, now I am facing one last problem: Sadly I am not able to scroll to the bottom of my SingleChildScrollView. This problem also occurs when removing the "footer" with the two buttons. Means, the SingleChildScrollView goes beyond the screen height (which is fine) but which is useless when I am not able to scroll to the bottom of my list. At the end of this post I have added an image so you can see the problem.
Here you can find my dartpad without the modal buttom sheet which is not supported yet on dartpart. However, because dartpad presents the web view instead of the mobile view I am not able to recreate the problem 100%. When using the mouse wheel to scrol you can scroll to the end of the list. But as you can see in the image below in the mobile version is does not work!
Does anyone has an idea how I can solve this?
I already have tried adding Containers with padding and margin to the bottom but this sadly doesn't work or leads to rendering issues.
There is also a stackoverflow post which seems to solve this problem but that leads to an rendering issue for me: https://stackoverflow.com/a/63613723/9445999
Image:
Kind regards and thank you!

GTK ListView With Multiple Objects?

How can I create a listview that includes other objects such as image, link, etc. in GTK? What I mean is, just like these Android ListViews:
http://www.vogella.com/articles/AndroidListView/images/listview_contextual10.png
What I want is:
http://pic002.cnblogs.com/images/2012/372551/2012021011374176.jpg
How can I do that in GTK?
The easy way is to create a custom widget that lays out the text and images how you want it, and then put that into a GtkVBox and put that GtkVBox into GtkScrolledWindow
This isn't really any easy way to do it with GtkTreeView

GWT ScrollPanel with Horizontal SimplePanel

I'm trying to implement a scrollPanel within a Horizontal Panel.
I read this post
GWT Horizontal panel with horizontal scrolling
The answer seems great, however I'm wondering if ravi wrapped his simple panel with a scroll Panel or vice versa.
Basically I wanted to know how the panels were nested within each other?
A scroll panel is nothing special - it's just a DIV element with some CSS set on it. That's what the answer to the other question means, as a SimplePanel is simply a Widget that appears as a DIV.
So what the other answer did was create a scrolling widget by:
Creating a SimplePanel as the content container
Set some CSS with the overflow-x attribute to the SimplePanel
Setting the content will now have a horizontal scroll bar (due to the CSS attribute).
If you prefer a more direct way of doing this check out UiBinder. Using it you can combine widgets/CSS/HTML elements in a form closer to how the browser renders your UI. So for example you can create a DIV with the required CSS to achive a scrolling container.

How do you get GWT 2.0 to accept clicks on two different Widgets added to a LayoutPanel?

Using GWT 2.0 I have an entry point that adds two Widgets to a LayoutPanel which in turn is added to the RootLayoutPanel. The Widgets both handle click events and have click events registered to them. The problem is that only the last widget added to the LayoutPanel can actually be clicked. Switch the order in which the widgets are added switches the widget that works. Add mroe widgets and still the only you can click is the last one added to the LayoutPanel.
Any idea why this is? Is there any reasoning behind the behaviour, or have I missunderstood what is happening under the covers? How do I gat all widgets in the LayoutPanel to accept events? Should I be using another panel class?
I'm not too bothered if the LayoutPanel prevents anything below it from being clicked, but want all Widgets added to it to be clickable.
Stupid Boy! (said in the voice of Captain Mainwaring)
There is no problem having two Widgets on a LayoutPanel accepting clicks. But if you adjust the Widgets' size by manipulating their elements' styles directly then the containing element created by the LayoutPanel will still cover the whole screen. In effect the last Widget added always covered everything else.
GWT school: D- Must try harder. Easily distracted...