How can I create a fixed size Gtk.TextView in Gtk+3? - gtk

I have a Gtk.TextView inside a Gtk.Fixed and I set it its width and height and wrap mode.
My problem is that I need to avoid the TextView expanding when the user inserts more text than what fits in the set size. In that case I just need to prevent the user from keeping writing.
Any help?

If you have a single line entry as input better use textentry instead of textview.
For text entry your can set the maximum length of textentry.
For development of UI using glade.
Moreover if your UI changes depending on configuration file from server,
there is a solution for this also, have all the widgets in the window, show/hide the widgets depending on the config file from server.

why dont you use GLADE for UI development ?.
It provides more handy ways to achieve your task.
In glade you have all the options to set, you can cross verify and check in real time.

Related

How to get text size or resize the widget according to the text size?

I am creating widgets in runtime and then change texts in them by using setText. The problem is the Size Box which contains the text doesn't update as "Size to Content" after i changed the text. is it possible to update this so it can resize according to the text?
I tried to get string size with getTextSize blueprint node, but it only works at drawHud event and hard to use outside of HUD blueprint (which i believe is almost obsolute after UMG?)
Any solution in blueprint or C++ is appreciated.

Dynamically Resize Controlled TinyMCE React Component

Background: we have TinyMCE React inside a few contexts where the parent element is manually resized by the user (resizable modal dialog, etc.) and we want the TinyMCE component to resize appropriately. In older versions, we did this using the resizeTo functionality documented here. However, that no longer seems to be available after the upgrade.
My previous attempt to resolve this involved using a key based on concatenating the width and height of the editor with a debounce while it was resizing. Basically, whenever the size changed by enough, I tore down the old component and rendered a new one whose config options included the new size. While this is largely effective, it causes an issue where, when you attempt to edit the field after resizing, it flickers and loses focus initially.
Unfortunately, we are using pixel-based size calculations, so specifying the height in percentages instead of pixels won't work.
What is the new official way to do this? Ideally, there would be some new version of editor.theme.resizeTo that we could use instead and dispatch with the key-based solution entirely, but I was unable to find it in any of the documentation.
Just wrap the editor in a div which has the calculated height and width, and then set the editor to height and width of 100%.

How to set a fixed part sash container data value

I am trying to make different UI layouts for my e4 RCP application depending on the resolution. I am trying to set a fixed container data value for my parts but have no idea how to do this. Basically in the layout below I have a partstash container with a part and another partstash with two parts. I want the partstashes to be a fixed size and not resizeable. How do i achieve this? Alternatively is there a way to ensure that the content within a stash container will auto resize and always fit?
Add the tag NoMove to the 'Part Sash Container' containing the parts that should not be resizable.
So here:
Setting the NoMove tag prevents the child part stacks and sash container from being resized

2sxc | WYSIWYG html editor table cell width

I wish to have the default table width display in the editor at a width that is visible as currently the default is close to zero width. The screenshot below shows the default width and below that is when you specify a set width via the properties option. Is there a way to have the table default to a certain desired width? Thx
At the moment not. There are various wishes for customizing the tinymce, but before we provide specific solutions we must find a generic method for custom configuration, as we want to be sure that we don't have to support tinymce as well. So this won't be available for some time, unless someone works out a solution and contributes it.
Why is it not possible to configure tinymce at the "normal" way with tinymce.init...?

How to make breadcrumbs responsive?

I have used bootstrap3 for RWD and customized my breadcrumb. But, it's not fitting in mobile size.
How can I make it responsive?
Attached screenshot of the problem.
Thanks
I have created a snippet on bootsnipp that may fit your needs.
http://bootsnipp.com/snippets/featured/responsive-breadcrumbs
You can configure this breadcrumb to
display only the last n elements. Ellipses are added at the beginning of the list if elements are hidden.
set a maximum size for each elements. Ellipses are added after the label if it's too long.
By setting breakpoints you can set the number of elements to display and their maximum size for different screen sizes and hence make sure there won't be any overflow.
You are going to have to code that yourself. Without your specific code, no one will be able to give you specific answers. That being said, here is how I would get set up to add custom code to my Bootstrap website.
Using less
First, create a new .less file - this file will be your new primary style sheet. In that file, import in the bootstrap.less file. Compile that file and link it in your HTML files. You should now have an exact copy of the out-of-the-box Bootstrap CSS, with access to all of the Bootstrap variables.
To make any additions, add them to that file underneath the import statement. So in your case, I would grab the variables for the media queries and breadcrumbs (found in variables.less), and customize the style of the breadcrumbs at smaller screens.
Note that Bootstrap is mobile first, which means that the default styles will be applied at the smaller screen, and you override for larger.
Not using less
If you are not comfortable using less, I would say this is a great opportunity to start. That being said, if you want to do it the old fashioned way, then just create a second style sheet that you link in, add it underneath the Bootstrap sheet, and code away.