Hello. I know that for Buttons (or ui.buttons), you can make the button look "inactive" and be insensitive to mouse/keyboard actions by giving it a "clicked" parameter of None.
My question is, is there a way to do this for other widgets? The specific case I want is scrollbars, but it'd also be useful to be able to do it to other items.
In fact, as a feature request for a future version of Ren'Py, it'd be great if all focusable widgets had an "active" parameter, default True, that controls whether they use their "inactive" style or not and whether they respond to mouse/keyboard actions or not.
Making widgets disabled/deactivated/inactive/insensitive
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Eileen-Class Veteran
- Posts: 1153
- Joined: Mon Jul 07, 2003 4:57 pm
- Completed: Elven Relations, Cloud Fairy, When I Rule The World
- Tumblr: alextfish
- Skype: alextfish
- Location: Cambridge, UK
- Contact:
Making widgets disabled/deactivated/inactive/insensitive
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Making widgets disabled/deactivated/inactive/insensitive
IIRC, sliders get to be inactive when their adjustment doesn't do anything interesting. I don't think the insensitive style for a bar differs from the idle style, however. (At least in the default themes.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Eileen-Class Veteran
- Posts: 1153
- Joined: Mon Jul 07, 2003 4:57 pm
- Completed: Elven Relations, Cloud Fairy, When I Rule The World
- Tumblr: alextfish
- Skype: alextfish
- Location: Cambridge, UK
- Contact:
Re: Making widgets disabled/deactivated/inactive/insensitive
That's fine, I don't actually mind about making it look different - I just want to prevent the user from scrolling them on certain occasions (when I want to centre the viewport on something important happening). Can I keep the existing scroll position while modifying the adjustment to make it "not do anything interesting"? Is there any sensible way to do that, or will I have to override the change() method on the adjustment?PyTom wrote:IIRC, sliders get to be inactive when their adjustment doesn't do anything interesting. I don't think the insensitive style for a bar differs from the idle style, however. (At least in the default themes.)
Thanks!
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!
- PyTom
- Ren'Py Creator
- Posts: 16096
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Making widgets disabled/deactivated/inactive/insensitive
IIRC, if you create an adjustment without a change method, it should not be changable. (This may have been broken in 6.5.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot]