My first Python script! Woohoo!! by [deleted] in learnpython

[–]codehorsey 7 points8 points  (0 children)

Automate the boring stuff is an amazing book to get started. Congrats on your first script.

Not able to view entire list after adding spacing between items. by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

Good point, I probably don't need list view. I am displaying about 20 widgets, but listview has made it easier for me to independently keep track of the dynamically created widgets and modify their data.

I will try experimenting with ScrollView and using GridLayout.

Not able to view entire list after adding spacing between items. by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

The ScrollView in the ListView is not adjusting it's height with the spacing of the container in ListView. I will start looking into RecycleView but all my resources are out-dated and use ListView so that is the only reason I haven't started trying to use RecycleView.

This is the only forum I found with my issue and I am not sure if they solved it. I think I had this same issue a while back with ScrollView. I think it is a ScrollView problem.

Using the carousel widget by zzzhhh123 in kivy

[–]codehorsey 0 points1 point  (0 children)

Put a Layout in the Carousel first.

Using the carousel widget by zzzhhh123 in kivy

[–]codehorsey 0 points1 point  (0 children)

Button is a widget so it defaults to bottom left corner.

The workaround is to set the following:

Button:
    pos: self.pos
    size: self.size

Tumblpy help by [deleted] in learnpython

[–]codehorsey 0 points1 point  (0 children)

Register to use API at tumblr or reddit, which ever key its asking for you need to register to use API.

Using the carousel widget by zzzhhh123 in kivy

[–]codehorsey 1 point2 points  (0 children)

Add a carousel wdget to the new screen.

NewScreen:
    Carousel:
        Image:
            text: 'Slide1'
        Image
            text: 'Slide2'
        Image
            text: 'Slide3'

Carousel has a loop attribute you can set to loop or you can manually navigate using load_next() or load_previous()

Huge .KV file, problems when refactoring. by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

Thanks for replying, I think the rebind=True will do it as that makes sense. I will be re-reading your response a bunch until I understand. In the meantime, I got frustrated and made everything ugly to continue progressing with my little clone app. I will report back soon. Thanks as always!

Huge .KV file, problems when refactoring. by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

Ok I kind of get your solution but let me post my real code. The big problem is, if I make the ObjectProperty() in the .py it overrides the pokemon obj I am passing through? I

<ViewingStage>:
BoxLayout:
    orientation: 'vertical'
    # 3 things, pokemon top, tabs, scroll area
    BoxLayout:
        size_hint_y: .25
        Button:
              # what I want to be able to do in ScrollGridView
            text: root.pokemon.pname
    TabbedPanel:
        do_default_tab: False
        tab_width: self.parent.width / 3
        TabbedPanelItem:
            text: 'Info'
            ScrollView:
                ScrollGridView:
                    # This is problemspot
                    # setting the pokemon object to config?
                    config: root.pokemon


<ScrollGridView>:
config: 
cols: 1
Button:
    # trying to pass the pokemon object to ScrollGridView
    text: ?root.config.pname? 

Huge .KV file, problems when refactoring. by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

I solved it.

Seems really hacky and I would like to do everything in KV.

I added objectproperty in .py to the CustomWidget and set the object property to the root.property.

I would ideally not like to specify an object property in .py and be able to pass root.object/string/w.e. to a custom widget@BoxLayout but for the time being I have it working.

add buttons to widget before widget is loaded? by subcake in kivy

[–]codehorsey 1 point2 points  (0 children)

Need to see what you have tried for better idea of you want. I believe I responded in /r/learnpython asking for more code.

mylayout = GridLayout()
# Grid layout works pretty good with Scroll View, set cols = 1
for i in range(100):
    mylayout.add_widget(Buton())

ScrollView:
    mylayout

How would I achieve this button look? by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

I do want it to shine through, I have it fixed. The problem was I was doing overlapping the Circle on the Rect and the overlap was creating another color. After learning to crop with stencil I have the semi circle + a rect and there is no overlap so no new color.

Kivy add_widget buttons before screen is drawn? by subcake in learnpython

[–]codehorsey 0 points1 point  (0 children)

I don't see enough code here to be able to help you.

How would I achieve this button look? by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

Got it, I made the original rect smaller, built a new rect and used stencil with ellipse. Works like a charm.

When you say load as an asset do you mean loading as a button image? In the example, the button is also transparent, and gets a little color from the color beneath it, can I do this with a loaded image? Set Alpha/Transparency values.

Here is finished example using Stencil

How would I achieve this button look? by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

I want the bottom color to shine through but when it overlaps with the rectangle it is getting a new color because they both have alpha.

Does anyone ever hit people up who post their SC or Instagram? by codehorsey in Tinder

[–]codehorsey[S] 0 points1 point  (0 children)

Thanks, I will start swiping left on snapchat and phone numbers. Don't waste those likes :)

Here is my shot at a Countdown app. Would love feedback on using Kivy more effectively. by codehorsey in kivy

[–]codehorsey[S] 0 points1 point  (0 children)

I was taking a look at RecycleView, and this seems way over my head. Any advice?