Displaying text on a swt button vertically - text

I'm trying to display text on a button. Instead of displaying it as "Vertical", I'd like to display it as
V
e
r
t
i
c
a
l
Any assistance is much appreciated.

You have to make your own widget to achieve it in SWT.
Here is a complete example that you can try. Hope it helps.

SWT buttons do support wrapping (since 3.7).
Button button = new Button(parent, SWT.PUSH | SWT.WRAP);
button.setText("V\ne\nr\nt\ni\nc\na\nl");
But unfortunately the lines will be centered as a whole and not individually, so the result does not look particularly good.

Related

ipywidgets updatable text area scrollbar

Using ipywidgets, I need to create an output text box which will display alert messages.
The box should include a scroll bar to be able to read previous messages.
ipywidgets comes with Layout, Textarea and Text functionalities but I could not figure out how to use them to my particular case.
Help and suggestions would be greatly appreciated here
Thak you

How do I make a window draggable without a header?

So basically I have this main window with just a bunch of buttons on it. I am hiding the default header by using self.set_decorated(False). I want to be able to drag the window around my screen by clicking anywhere that's not a button. Is this possible? I haven't been able to find anything on this except for self.begin_move_drag(self.button_drag, event.x_root, event.y_root, event.time) which I don't really understand.
hb.props.custom_title = Gtk.Label(label=" ")

pyqt context menu with multiple qlineedit widgets

I hope someone can help me out with this.
I have a pyqtgraph context menu and want to add my own Z-Axis. I can create a qlineedit widget but I am not able to create multiple widget on the same line in the context menu as show below (e.g. radio button and 2 text boxes on same line)
As a minimum I would like to achieve:-
Z Axis -> [input value], string, [input value]
I've had a look in qmenu but couldn't find what I needed. Anyone know how to achieve this.
Also if anyone knows how to change the size of the X Axis qlineedit boxes and make them bigger it would be great as they are a bit squashed as you can see.
Someone on a different forum was able to help me with the answer so I thought I would also post it here for future users.
What you have to do is go into the site-packages for python and find pyqtgraph/graphicsItems/ViewBox/. In there are several files called
axisCtrlTemplate_*.py
A couple of lines down in the ui_form is the following line which you just need to increase the width (e.g. 450)
Form.setMaximumSize(QtCore.QSize(450, 16777215))
Hey presto fixed.
Also in the same location is a file called
ViewBoxMenu.py
you can see how the context menu is written here and I will use this information to create my min and max values which are created in a ui (qtdesigner) and then added to the menu

On becomeFirstResponder Show Placeholder

Hi when I open up my textfield (becomeFirstResponder) it shows my text as text. How can I take the users input for that textfield (14.25) and make it a .placholder text. For example if the user puts in 14.25 in the text field when they get out and look out at the textfield it should be black like text, but when they click on the textfield again to edit it the current text (14.25) changes from .text to .placholder. Does that make sense? If it does not please let me know.
I dont really know what to do but I made a shot at it and nothing happened haha.
billAmountTextField.text = billAmountTextField.placeholder;
Thanks for your help!
Not sure to understand, but are you trying to replace the placeholder by the text, at the time you start editing? Of so, your line is in the wrong way. Try this:
billAmountTextField.placeholder = billAmountTextField.text;
Moreover, you need to clear out the text itself, if you want the placehold to show up.
billAmountTextField.text = #"";
Makes sense?

Collapsible divider for split pane

in JavaFX 2.2 I want to use a split pane (or better: any component with two dividers) where the dividers can be collapsed / expanded again. Is there any Component which does this already for me (and I just don't get it) or do I have to implement this myself? Would you recommend to use Swing here?
Thanks in advance :)
Edit:
Maybe for a better imagination of my problem, the following information is neccessary: I want to split my contents vertically.
content | content | content
(where '|' are the dividers).
JavaFX has a SplitPane to do this.
The pane does not include a button for collapsing and expanding the divider. Either you need to program such a button yourself or the user can just manually drag the pane dividers.
See also: Can we add OneTouchExpansable button on Javafx SplitPane like swing JSplitPane
I would not recommend using Swing for this unless you have other important reasons to use Swing.

Resources