shoes / shoes3

a tiny graphical app kit for ruby
http://walkabout.mvmanila.com
Other
181 stars 19 forks source link

Progress lives in an unequal world #357

Closed dredknight closed 7 years ago

dredknight commented 7 years ago

Progress cannot be hidden with the normal options. Somehow only button hiding works.

Shoes.app do
    @bar = progress
    @bar.hide
         button ("hide bar") { @bar.hide } #### this works somehow
    progress( left: 100, top: 200, hidden: true)
    debug(@bar.methods)
end

Also there is no "toggle" method for it. Why not if it can be hidden?

IanTrudel commented 7 years ago

What is the problem here, officer?

@bar.hide doesn't work at that time because Shoes objects are not available at creation time. This is why we came up with the famous start {} approach.

It seems that hidden hash parameter is not working. I did print out the value of the parameter using the progress>>hidden method and it displays correctly (true or false depending of the value on line 5).

Also there is no "toggle" method for it. Why not if it can be hidden?

No idea. Shall we implement it?

dredknight commented 7 years ago

@BackOrder I did not know that. What you say works.

No idea. Shall we implement it?

If it is not a big deal to do why not? it is object just as everything else :).

P.S. Actually I knew it but did not made the connection that hide visually adjust something that does not exists.

IanTrudel commented 7 years ago

Looking around Shoes internals tells me toggle applies to static shoes elements such as image, pattern, plot, shape, svg and textblock. It comes in a series of features defined by CLASS_COMMON2.

Unfortunately, CLASS_COMMON2 features are not meant for widgets. It is now my understanding that no widget has toggle but they have common control hide feature as defined in native.{c,h}. There are normally no reason to toggle widgets.

dredknight commented 7 years ago

Alright then this issue is over. Closing down :).