I have a kivy dropdown menu and I can't get the width of the button to change. Does anyone know how to do this? I attached a photo of what the button looks like.
Here is the line where i add buttons:
self.drop_down.add_widget(Button(text=address, auto_width=False, size_hint=(None,None), height=self.height/15, width=self.width/2))
In the kv file dropdown class is empty but i have played around with various layouts to try to change the width but nothing i try works.
Changing the values for width seem to only change the label width where the text will move around on the button but the button itself wont change. The Widget is suppose to size itself to the parent width but that is not happening either. I found the value attach_to where my understanding is that i can specify what parent widget to hook to. Yet that didnt seem to change anything.
A normal dropdown list is different from a actiondropdown list and you modify the width in different ways. The way stated above is for a dropdown where you use auto_width set to False and then set width. But with an actiondropdown you use dropdown_width to modify the width.
Related
I need to change how the checkable box of a QCHeckBox looks, and not simply with CSS, but with a texture file. The closest thing I found was changing the icon parameter of the widget.
But a) it doesn't update, and b) It is located after the box, which I'm actually trying to change.
Is it possible to change the checkbox itself?
Confusingly, those icon properties are associated with the QAbstractButton parent class, which doesn't have the concept of a checkbox icon. So they just add an icon to the label of the button, which results in the behaviour you describe.
To change the actual checkbox icon, the best option I've found is to use a stylesheet. All the gory details are here.
In summary, something like this will do as the QCheckBox's stylesheet:
QCheckBox::indicator:unchecked {
image: url(:/images/checkbox_unchecked.png);
}
QCheckBox::indicator:checked {
image: url(:/images/checkbox_checked.png);
I have a very specific question.
I have a tkinter button. Each time I click it I get a pop-up window with an Entry box. Enter a text and press enter I can change the text of this button. I can do it as many time as the as I want.
Now the question is:
can I make the button text to have different color and font size?
Say the original button text is "btn 1". The first time I click it. The text becomes "btn 1\nFirstClick". The second time the text is ""btn 1\nFirstClick\nSecondClick".
I have all the code worked out as I wanted. But now I want "FirstClick" to be in Red and "SecondClick" to be in Green".
Is that possible? I googled and can't find the answer.
You cannot use multiple fonts or colors in a single button. Your only option would be to create a custom widget that looks and behaves like a button, but which is implemented with a Text or Canvas widget. Those two widgets allow you to use multiple colors and fonts at the same time.
Standart StatusBar image
<-- So, here it how it looks in my application now. How can I make the height of it smaller? For e.g. in Google Chrome when you pointing some link it shows in the grey bar at the bottom of the page, I want same size.
Chrome is not using a GtkStatusBar (or any other GTK widgets, for that matter).
If you want to change the appearance of a GTK widgets, you'll have to either tweak the theme or use a custom widget, with your own sizing policy.
Im not sure what this is called, so its hard to lookup. I want to get a set of images that have a unique identifier and the put some corresponding text information next to it, inside of an application. When more images are loading a scroll bar can go through them. I dont know which methods or how this is possible. For example, through other threads i found how to load images using a list widget and switching the items to an icon. However with this method I dont see how to put text next to it. Can this be done with a table, or a tree? I have been using qt Designer but I dont see anything like this available.
You can use QListWidget for that. Each item would represent an image (item's icon) and all text to the right of it. Define iconSize property of list widget to enlarge item icons. Use \n in item texts to add line breaks.
I'm trying to get a QFrame to serve as a "display area" for a couple different kinds of information, eg: you click on something in a list view and an info pane shows up in the frame
to give you information about it, you click on a different item and a different pane shows up.
Having trouble swapping the different frames in and out of the QFrame though, is there a way to do this?
Using QStackedWidget is probably the most standard solution.