Slick Forums

Discuss the Slick 2D Library
It is currently Mon May 20, 2013 6:36 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Wed May 23, 2012 9:51 pm 
Offline

Joined: Thu Nov 05, 2009 3:38 pm
Posts: 21
Hey,

I started with TWL and I like it very much, anyway I have some beginners questions:

1. There are inputMapDef actions like *selectAll *cut *copy *paste.
Is there a list in the docs somewhere? At first I didn't realise, that they have actual behaviour, just thought they where some arbitrary strings...

2. Why are some theme names starting with this dash, e. g. "-smiley" and "-defaults" and not "smiley" and "defaults", does it make any difference?

3. Is layout() called on every widget, and when? When do I have to overwrite it? Which positioning possibilities do I have, "only" setPosition() and setSize() ?

4. Is there an TWL IRC channel, I read it somewhere...

Thanks a lot in advance for your support!
Kind regards,

Stefan


Top
 Profile  
 
PostPosted: Wed May 23, 2012 10:16 pm 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1171
Hello Stefan,

1) how actions are defined depends on each widget - for example here is the action mapping of EditField

2) this is purely a convention - I use the leading dash to indicate that this is not something final/useable (to assign to a theme) but more of an intermediate element - eg to allow it to be reused

3) layout() is called on every widget and it must only position it's own children, if your widget has no children then you don't need to override it. Instead of doing a manual layout you can use DialogLayout, BoxLayout, ColumnLayout or the new BorderLayout to handle layouts.

4) you can find me (and others using TWL) in #lwjgl on freenode.

Regards
Matthias

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
PostPosted: Fri May 25, 2012 4:30 pm 
Offline

Joined: Thu Nov 05, 2009 3:38 pm
Posts: 21
Thanks for the answers!

I have another beginners question: I can add Widgets to another Widget via add(Widget child) method.
What do I need a Container for then?

Is there any doc how the different layout widgets work?

Thanks again!


Top
 Profile  
 
PostPosted: Sat May 26, 2012 11:44 am 
Offline
Game Developer
User avatar

Joined: Thu Mar 03, 2011 6:22 pm
Posts: 534
Every Widget has some doc :) Also check out the TWL-Examples project where ouy can find a lot of help.

_________________
Current Projects:
Image Mr. Hat I
Image Vegan Vs. Zombies
Projects:
RadicalFish Engine - Build on top of Slick2D, Ideas, Bugs? Open an Issue ticket!


Top
 Profile  
 
PostPosted: Sun May 27, 2012 10:25 am 
Offline
Slick Zombie

Joined: Fri Jan 29, 2010 7:02 pm
Posts: 1171
It is true that every Widget can have children. But the basic Widget class does not do any kind o layout (the method is empty). There are a few layout widgets which just layout their children to some rules (Container, BoxLayout, BorderLayout, ColumnLayout, DialogLayout). But you are free to subclass Widget and perform your own layout by overriding the layout() method.

_________________
TWL - The Themable Widget Library


Top
 Profile  
 
PostPosted: Wed May 30, 2012 7:43 pm 
Offline

Joined: Thu Nov 05, 2009 3:38 pm
Posts: 21
thanks for the support!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group