I'm trying to write application in kivy. I would like it to have listview with custom row layout (label on top, below image scaled to window width and below some images, labels and button - see pic). Is it possible to do that with kivy.uix.listview? Or some other way? I was looking on docs but I couldn't find answer to my question.
Yes, it is written in docs here: Adapter
Use either cls or template property to link a customized widget to a list view.
Here you can see cls bound to ListItemButton. Put your own widget in its place.
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 am quite new to wxPython and want to build a wizzard. I used this guide as a base ("wxPython: How to Create a Generic Wizard"). I tried to add some widgets the panel, e.g. some radio buttons at the second page by inserting the following code at line 56 in add_page():
if(title=="Page 2"):
k1=wx.RadioButton(panel,-1,'Argument1',(35,60),(150,20), style = wx.RB_GROUP)
k2=wx.RadioButton(panel,-1,'Argument2',(35,80),(150,20))
But as soon as I try to add some sizer to the the second panel, all pages are affected. I tried quite a few variations of where to place the sizers, but without success. So my question is: is this the appropriate place to modify the individual pages and could someone give me a hint of how to write a minimalistic example of e.g inserting a boxSizer and a button in the first page and a boxSizer and a RadioButton in the second page?
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.
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.
I want to set color like blue and red in a application, is something like
this image.
I imagine that I can do it with css styles, but if is there other way much more simple like set a property or a class.
I use GTK 3.12 and Python, but you can show me examples in other lenguages and I can traduce it.
The correct way to do it is with the suggested-action and destructive-action CSS classes. Here is some documentation. Is there any particular objection that you have against CSS?
Use this code:
button.get_style_context().add_class(Gtk.STYLE_CLASS_SUGGESTED_ACTION)
or
button.get_style_context().add_class(Gtk.STYLE_CLASS_DESTRUCTIVE_ACTION)
before you add the button to the header bar.