Skip to content

Proposal: fluent API #181

@zabulus

Description

@zabulus

Hi there. Good library, looks pretty awesome!
But I have a proposal for API.
From samples:

	win.Add (
	    // The ones with my favorite layout system
  	    login, password, loginText, passText,

It's quite hard to gather all controls, that I've spawned before to add to win through Add method (I've created around 5 or 6 label-text pairs, and it's already cumbersome to register them all in win).
Proposal is following:

loginLabel = win.Label("Login")
   .Position(3, 2);
passwordLabel = win.Label("Password")
   .Position(Pos.Left(loginLabel), Pos.Top(loginLabel) + 1);

This will allow to combine adding to win and initialization of objects. I'll create my own extension methods, as I see there is nothing complicated and that could be done from consumer side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions