changeset: 51:02a31d970b68
tag: tip
user: pancake <pancake_AT_nopcode.org>
date: Fri Jun 11 11:06:45 2010 +0200
files: TODO swk.c t/tlock.c
description:
update TODO file
fix initial break in tlock.c test program
fix segfault and invalid w->col value
diff -r 4b4efe4cf012 -r 02a31d970b68 TODO
--- a/TODO Fri Jun 11 10:52:32 2010 +0200
+++ b/TODO Fri Jun 11 11:06:45 2010 +0200
@@ -1,30 +1,40 @@
TODO
====
+ * support multiline text widget
+ * support for user-defined input handler
+ (when input widget is activated, run xterm -e vim str > text)
* add support for negative colpos (align to right)
- * allow to set absolute font size
- * buttons must be 3 line height
* receive fine-grained x,y in Point? for sketch or imaging stuff is important
* support for clipboard (implemented in gi_ backend)
* simple way to define callback for buttons instead of reimplementing widget (?)
* full text editing widget (multiline, cursor support, text format, ...)
- * scroll on focus (if focused widget is not in screen, just scroll there..)
+ - this must be done with an external input handler (use vim, dmenu, .. )
* mouse bindings in config.h (which mouse bindings we need? wheel to scroll?)
- * allow widgets to force its own size (height, width)
+ - add horitzonal scroll wheel support
* add support to resize images (scaling)
* only focus buttons and entries (input widgets)
+ - will make the design inconsistent and the code more complex
+ * allow to load images from memory instead of files
+ * define default image path in config.h
+
+Transitions
+===========
+ * transitions (to change from one window to another)
+ - this can be done in a simple loop() calling swk_update and using colpos
+
+Events
+======
+ * We need a way to enqueue events
* add function to click button 1, 2, 3, ... // clicking from code..
- * allow to load images from memory instead of files
- * default image path (?)
- * transitions (to change from one window to another)
-absolute/relative
-=================
+Think about a decent absolute/relative
+======================================
* column split position (w->colpos)
- * scrolling box
- * font size
+ * scrolling box (..)
+ * font size (font_inc, font_dec, font_set)
-USABILITY GUIDELINE
-===================
+Design rules
+============
* useful
* usable
* transparent
diff -r 4b4efe4cf012 -r 02a31d970b68 swk.c
--- a/swk.c Fri Jun 11 10:52:32 2010 +0200
+++ b/swk.c Fri Jun 11 11:06:45 2010 +0200
@@ -53,6 +53,7 @@
for(w->r.w=col; ; b = w->boxes[1]) {
swk_fit(w);
roy = oy = 0;
+ if (b)
for(;b->cb; b++) {
w->_e.box = b;
if(IS_SCROLLBOX(b))
@@ -248,7 +249,7 @@
swk_update();
break;
case EMotion:
- w->col = (e->data.motion.x > w->colpos)?1:0;
+ w->col = w->boxes[1]?((e->data.motion.x > w->colpos)?1:0):0;
for(b=e->win->boxes[w->col]; b->cb; b++) {
if(SWK_HIT(b->r, e->data.motion)) {
e->win->box = e->box = b;
diff -r 4b4efe4cf012 -r 02a31d970b68 t/tlock.c
--- a/t/tlock.c Fri Jun 11 10:52:32 2010 +0200
+++ b/t/tlock.c Fri Jun 11 11:06:45 2010 +0200
@@ -36,7 +36,7 @@
if(e->type == EExpose) {
int pos = e->box->r.y;
if(pos<3 || pos>e->win->r.h) {
- printf("swkexit\n");
+ printf("swkexit coz pos = %d\n", pos);
swk_exit();
}
}
@@ -47,6 +47,7 @@
{ .cb=swk_label, .text=timestring },
{ .cb=swk_separator },
SWK_BOX_NEWLINE(-1),
+ SWK_BOX_NEWLINE(4), // Trick to avoid unexpected swkexit
{ .cb=mylocklabel, .text=" slide out to unlock", },
{ .cb=NULL }
};
Received on Fri Jun 11 2010 - 09:29:50 UTC
This archive was generated by hypermail 2.2.0 : Fri Jun 11 2010 - 09:36:05 UTC