emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suggestions about UiKit for Emacs


From: Yuan Fu
Subject: Suggestions about UiKit for Emacs
Date: Wed, 26 Sep 2018 21:52:55 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.0

Hi everyone,

I'm trying to make this text-based GUI framework for Emacs. I am aware of Widget, but it is half done to me, lacking some important features like auto layout.


Basically this framework frees developers from fiddling with markers, text properties and inserting and deleting texts.

It provides a abstraction just like other GUI frameworks, like cocoa. With this framework, a Emacs hacker can put up a little convenient user interface for his/her package easily.


With this framework, developers are able to create scenes, and adds views to them, views can be buttons, switches, labels, tables and other UI element. The views are organized by grouping into stacks. Actually the scene is the top level stack.


Message passing is mostly done by symbols, so one can create a button by (uikit-make-view 'button 'button-name)

and define the function to be called by (defun uikit-button-name-pressed () ()).


The problem I'm having now is the auto layout part. The version I have designed right now seems a bit complicated:

So when a scene draws itself on a buffer, it recursively asks its sub-views to draw. And for a stack or view to draw, they need a position, that's when auto layout comes in to the play. Currently I have these rules for a stack to arrange its sub-views: equal-spacing, by-portion and stacking.


Equal spacing basically means the stack puts equal space between its sub-views to fill the stack.So the stack size is defined before auto layout, either set by its parent stack or set in the code by the developer.

By portion means the developer specifies how much portion of the stack does each sub-view takes. So the stack size is defined before auto layout, either set by its parent stack or set in the code by the developer.

Stacking means the stack "stacks" each sub-view one after another, so the stack size is depended on its sub-views.


I'm worried that the rule getting too complicated, as you can see, some stack rules require to know sub-view's size before it knows its own size, some stack rules are the opposite: the stack's size has to be know before auto layout.

Could you give me more suggestions about auto layout? Please ask any further questions if I'm not clear. And I'm appreciated to any suggestions about the design and implementation of the framework.

I've put my code to gist since it's a bit long for an email. You can find it at

https://gist.github.com/casouri/1bc2e29fa9679d2c9ed705a324bfd30d


Thanks.


Yuan Fu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]