all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: emacs-devel@gnu.org
Subject: Suggestions about UiKit for Emacs
Date: Wed, 26 Sep 2018 21:52:55 -0400	[thread overview]
Message-ID: <87a3e21a-4ffa-4460-a45c-5f01c832f9d4@gmail.com> (raw)

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	other threads:[~2018-09-27  1:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a3e21a-4ffa-4460-a45c-5f01c832f9d4@gmail.com \
    --to=casouri@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.