How to auto-size toplevel TCL/TL form to match different height notebook tabs - ttkwidgets

I have a TCL/TL form with 3 Notebook tabs. Each tab has very different layouts and therefore needed heights. How do I get the toplevel form height to only be what is needed for each tab? I have looked at "wm geometry" and ttk::style, probably incorrectly, but do see how to make that dynamic when changing tabs. Thanks in advance.
Create a form with 3 tabs that changes size (height) when changing between tabs.

Related

NS button text interprets FontAwesome

If I set the text of the Button whose font is FontAwesome to something like "Download" - it interprets 'down' as an font from FA as well as 'ad'
e.g. Open = it'll display O and then a pen icon from FA.
Very weird - how can I stop this.
I'd like the button text to contain both FA icons (specified with unicode escape codes) and regular text.
I haven't used FontAwesome recently, I recall they use to denote icons by character code so there were no issues in combining text along with icons, not sure if that's changed now.
As a workaround you can use formattedText instead of text. You will be able to use different fonts within Button with 2 different FormattedString definitions, one for icon and another for text.

Display paired lists

I want to display two paired lists with an input -> output setup. For example, list one might be (a,b,c,d,e) and the second might be (1,2,3,4,5). The user should be able to scroll both lists at once. That way the user can see which pairs match up. It would be nice if the user could drag and drop to sort the list, but that isn't a requirement, I can make do without it.
I tried Taifun's sortable list, but I can't scroll two of those lists together.
I have also tried two list views inside a horizontal arrangement inside a vertical scroll, with the list view heights as automatic, so they are as tall as the elements inside so that the vertical scroll can move up and down instead. The problem with that is when the list view height is set to automatic, it doesn't change sizes to fit its elements.
Does anyone know how to do this?
I decided to use the following setup, and I am pretty happy with how it turned out.
When the user presses "Add item", they can enter an input (segment) and output (replacement). The items show up on a sortable list view, separated by a special dash character so I can break them back up into two paired lists. If someone tries to use that dash, theirs is replaced with a normal hyphen (-). Because the list view trims spaces, the first leading and the last trailing spaces (if any) are replaced with a caret and converted back when saving (^). When the user presses delete, a normal list view appears where the user can click on a pair and is prompted to delete it. The Settings button in the screenshot is just a back button to the main settings menu.
I hope this helps anyone looking for a way to display two paired lists together while avoiding the problems of scrolling and an overly complicated UI.

Scrolling text in a dropdown menu

I' m experiencing a little problem reguarding the marquee tag.
I have a select dropdown menu, which has some option. Some of those option contain text longer then the width of the select tag.
I just want to make those text scroll from right to left. I tryied out the marquee but it haven' worked.
Any idea on how to show the hidden overflow text? It's not necessary that the texts moves, I would like to add the chance to view the cut text. Resizing is not allowed in this case(most of the option are made of just one or two words, the others are quite longer)
Thank you all for your attention.
Filippo

VS2012 Text Editor Width

Is it possible to change the width of the text editor in VS2012 - I've got a fairly wide screen and use fairly small text so I end up with a lot wasted real-estate in the middle of my screen.
I don't want to turn off word wrap - I just want the wrap to start further right on the line. If that makes sense!?
You can set this with HTML in Visual Studio 2012 but there is no global setting and it's missing in quite a few languages.
You can just put another "dummy" window next to the one you are writing in, so the actual editor window will be smaller. You can put it on the left if you want to pan the text to the right, and to the right if you want to shorten the lines.
I actually found the answer elsewhere; VS doesn't appear to provide this functionality but Resharper does. Resharper -> Options -> Code Editing -> C# -> Formatting Style -> Line Breaks and Wrapping -> Right margin (columns)
I put mine to 200 which fixed the issue
I know that this is not what you are looking for, but I believe it solves the same problem. I too have a fairly large screen and try to make use of it as optimally as possible.
I hate tabbing between code or design tabs and try to avoid that as much as possible.
VS has a feature that permits the user to create Horizontal or Vertical Tab groups and ever since I have started using it, I have found it very helpful. These options are present in the context menu by right clicking the tab or in the VS Window Menu (Menus are seen only if the tab groups feature is not active).
I have created a screenshot with Vertical Tab Groups created as shown below. In this example, I have a overview of both the designer and the code view at the same time.
We can use tab groups whenever there is a dependency such as comparing code, redesigning a module, etc. I know it takes a little time to get used to this feature but try it out and see :)

Cells & cellgroups in mma

This question and the comments and answers prompted this question. How do I effectively use Cells and CellGroups in mathematica? I've always only programmed systematically inside the input cells, entering the next line in a new cell after evaluating the previous. Looking around at the different options available, this seemed inefficient.
How do I use these more effectively? I tried organizing my code into sections using command-5 and into subsections, etc. But then when I try to get back to input cell with command-9, it doesn't evaluate it. I'm sure I'm doing something wrong, so help is appreciated.
Cell groups are just that, a way to group cells together. These groups can be easily selected, executed as one, and opened/closed (collapsed). By default these groups are indicated by a series of blue brackets to the right of the cells:
As seen above, output cells are automatically grouped with the input cell that created them. Also, the Section cell automatically groups the Text, Input, and Output cells below it. Finally the Title cell groups all cells below it, including the Section cell.
The different classes of cells that are available, such as Title, Section, etc., are determined by the active Stylesheet. The way they group is controlled by the option CellGroupingRules. This is a more advanced area, and details are probably better addressed in a different question.
Cell Grouping can be done either automatically, the default, or manually, or to a limited extent by a combination thereof. This is all handled by the menu commands in Cell > Grouping > ... or the keyboard shortcuts listed there.
If using Automatic Grouping, then styling a cell in a style that groups (as controlled by CellGroupingRules) will automatically group "lesser" cells and cell groups beneath it.
To style a cell, select the entire cell, not just the cell contents, by either:
clicking on the blue cell bracket (or the area where it would be if it is hidden)
clicking within the cell and using Alt+. until the entire cell is selected
clicking and dragging from above the cell, where the cursor is horizontal, to below the cell
Then, use menu Format > Style > ..., or the corresponding key combinations.
The same methods can be used to select cell groups, rather than individual cells.
To create a new cell of a particular style:
click outside of existing cells where the cursor is horizontal
this should create a horizontal rule as shown in earlier illustration
specify a style, again with Format > Style > ... or keyboard shortcuts
start typing (or paste) the contents of the new cell
To create a new Input cell, the default style, simply do step (1) and then type or paste the input.
It depends on your stylesheet. Input is not the nineth numbered style in every stylesheet. Also, you have to select the cell bracket to change a cell's style.
I use sections particularly to be able to use folding, i.e. the double clicking on the cell group bracket to hide the lower ranking cells. That makes for a clean document. It doesn't do anything with the Input cells (except for the context option).

Resources