all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Suggestions about UiKit for Emacs
@ 2018-09-27  1:52 Yuan Fu
  0 siblings, 0 replies; only message in thread
From: Yuan Fu @ 2018-09-27  1:52 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-27  1:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-27  1:52 Suggestions about UiKit for Emacs Yuan Fu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.