deactivate props

3 views
Skip to first unread message

cremes

unread,
Oct 6, 2011, 10:54:11 AM10/6/11
to limelight
I've searched through the tutorials and rdoc but I can't seem to find
how to deactivate or disable a prop while keeping it visible.

I have a button on the screen. When a user clicks it, I would like the
button to be greyed out and for several text boxes on the screen to
become uneditable. What are the prop commands to achieve this?

cr

Micah Martin

unread,
Oct 6, 2011, 1:41:43 PM10/6/11
to limelig...@googlegroups.com
CR,

Assuming that you're using the "button" player and the "text box" with limelight 0.5.*, you can reach into the native Swing components like so:

button_prop.button.disable
text_box_prop.text_box.disable

Micah

Chuck Remes

unread,
Oct 6, 2011, 4:51:30 PM10/6/11
to limelig...@googlegroups.com
I don't get an error, but it also doesn't work. The button remains enabled.

I'm doing:

def mouse_clicked(event)
... bunch of stuff
self.button.disable
end

When I inspect self.button it looks correct to me.

#<Java::LimelightUiModelInputs::Button:0x4574aee5>

Is there anything else I need to do to get the button to update and disconnect it from future events?

BTW, this is against the last gem release on JRuby 1.6.3.

Chuck

Micah Martin

unread,
Oct 6, 2011, 5:09:30 PM10/6/11
to limelig...@googlegroups.com
Ah.. you'll probably have to refresh the disabled props… or the whole scene so that they repaint.

scene.refresh

Micah

Chuck Remes

unread,
Oct 6, 2011, 5:05:11 PM10/6/11
to limelig...@googlegroups.com
More info...

It *does* grey out like it should be disabled, but I can still click it. Clicking it also delivers mouse_clicked events.

Also, the text boxes do not display as disabled until I click on them. When I do, the box repaints.

This is on OSX 10.6.8, latest Apple JVM.

cr

On Oct 6, 2011, at 3:51 PM, Chuck Remes wrote:

Micah Martin

unread,
Oct 6, 2011, 5:24:31 PM10/6/11
to limelig...@googlegroups.com
Chuck,

Please keep in mind that limelight is still beta. Disabling props is not fleshed out at all in limelight. It should work but you might find some quirks. You'll probably want to check if the button is disabled in the mouse_clicked action to behave properly.

Micah

Chuck Remes

unread,
Oct 6, 2011, 5:18:31 PM10/6/11
to limelig...@googlegroups.com
My copy doesn't have a #refresh method on Scene or any other Limelight class.

I searched through some of the examples and saw a call to "screen.update" where screen is a scene. That worked. The Scene docs and Prop docs do not document this method.

cr

Micah Martin

unread,
Oct 6, 2011, 5:29:01 PM10/6/11
to limelig...@googlegroups.com
Sorry.. 'update' is what I meant. It's a hack to get past issues like this and it's been removed in newer branches of development.

Micah

Chuck Remes

unread,
Oct 6, 2011, 5:32:39 PM10/6/11
to limelig...@googlegroups.com
Understood. I appreciate it as is with warts and all. :)

As you suggest, I'll do my own state tracking in the event handlers and ignore double clicks out that way.

Any particular plans for future development of Limelight? The github repository has been rather quiet for about a year...

cr

Micah Martin

unread,
Oct 6, 2011, 5:44:02 PM10/6/11
to limelig...@googlegroups.com
Yes. Many plans. Although real world work tends to get in the way. Last year we whipped of a Clojure API to demo at ClojureConj. That was fun and it triggered a fairly major effort toward making Limelight multilingual, hence the big multilingual branch.

The newest efforts also involve removing all traces of Swing from the framework. So widgets like buttons and text boxes are managed and drawn by limelight.

Although there was a big gap in effort on Limelight.. it has been renewed in the last month. So much to do….

Micah

Reply all
Reply to author
Forward
0 new messages