Comments (4)
@meruby
If you overwrite Shoes::ListBox#text method like this, you can get nil
when you don't select anything.
class Shoes::ListBox
alias :_text :text
def text
return unless @real.active_text
_text
end
end
Shoes.app do
lb = list_box items: [1, 2, 3, 4]
button 'print' do
p lb.text
end
end
But in the above code, once you select one of items, you will never clear the selected item. So, IMHO, it's better to add nil in item list like this: list_box items: [1, 2, 3, 4, nil]
One more thing I think we should add to listbox is if :entry is set to true, allow user to set text value which might not be in the list items.
Ah,... what does it mean to add?
It means that we should add the user input value to the array of items
?
from green_shoes.
If user has det default value to say 9 in list box, but list contains only
[1,2,3,4,5], we should allow 9 to stay in listbox text if :entry is set to
true. listbox items list will be still same [1,2,3,4,5].
Samir
On Mon, Aug 27, 2012 at 7:13 AM, ashbb [email protected] wrote:
@meruby https://github.com/meruby
If you overwrite Shoes::ListBox#text method like this, you can get nilwhen you don't select anything.class Shoes::ListBox
alias :_text :text
def text
return unless @real.active_text
_text
endend
Shoes.app do
lb = list_box items: [1, 2, 3, 4]
button 'print' do
p lb.text
endendBut in the above code, once you select one of items, you will never clear
the selected item. So, IMHO, it's better to add nil in item list like this: list_box
items: [1, 2, 3, 4, nil]One more thing I think we should add to listbox is if :entry is set to
true, allow user to set text value which might not be in the list items.Ah,... what does it mean to add?
It means that we should add the user input value to the array of items?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/67#issuecomment-8052811.
- Samir Patel
from green_shoes.
You mean the following snippet should work well. Right?
Shoes.app do
lb = list_box items: [1, 2, 3, 4], entry: true, choose: 9
button 'print' do
p lb.text
end
end
If so, I'll be able to update Green Shoes.
But if there is still my misunderstanging, please let me know.
from green_shoes.
Yes, this should work well. Thanks for accepting my suggestion.
Samir
On Tue, Aug 28, 2012 at 9:52 AM, ashbb [email protected] wrote:
You mean the following snippet should work well. Right?
Shoes.app do
lb = list_box items: [1, 2, 3, 4], entry: true, choose: 9button 'print' do
p lb.text
endendIf so, I'll be able to update Green Shoes.
But if there is still my misunderstanging, please let me know.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/67#issuecomment-8092081.
- Samir Patel
from green_shoes.
Related Issues (20)
- Pango font_cache assert when doing parallel downloads HOT 1
- Object#exit() does not implement status parameter HOT 18
- Running in scite on windows shows segmentation fault HOT 2
- button does not work in conjunction with animate? HOT 2
- win32api (LoadError) on Ubuntu 12.10 / rvm ruby-1.9.3-p385 HOT 1
- Is there any way to display data in table format. HOT 2
- flows, para's, and caption issues HOT 2
- no such file to load -- glib2.so HOT 4
- The latest cairo gem drops windows support on ruby 1.9.3 HOT 3
- Sudoku on Shoes uses a fantastic
- Error video sample
- Styles not working HOT 1
- Some elements stays in the window when switching url HOT 1
- Button can only be clicked once HOT 1
- Error raised when attempting to run a 2nd instance of a green_shoes application from another thin client
- Image method cannot be provided no parameters
- Is the project alive? HOT 2
- better built in error handling
- Ruby gem on Linux Mint 19.1
- failed to require green_shows on Windows 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from green_shoes.