[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Antiright-devel] antiright/xshell button.c
From: |
Jeffrey Bedard |
Subject: |
[Antiright-devel] antiright/xshell button.c |
Date: |
Wed, 05 Sep 2007 18:19:01 +0000 |
CVSROOT: /sources/antiright
Module name: antiright
Changes by: Jeffrey Bedard <jefbed> 07/09/05 18:19:01
Modified files:
xshell : button.c
Log message:
Fixed button layout.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/xshell/button.c?cvsroot=antiright&r1=1.10&r2=1.11
Patches:
Index: button.c
===================================================================
RCS file: /sources/antiright/antiright/xshell/button.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- button.c 5 Sep 2007 17:36:50 -0000 1.10
+++ button.c 5 Sep 2007 18:19:00 -0000 1.11
@@ -100,12 +100,16 @@
expose(button);
}
-#define SETUP_BUTTON_EVENTS(button)\
- button->events.expose=&expose;\
- button->events.configure=&configure;\
- button->events.key_press=NULL;\
- button->events.button_press=&button_press;\
+
+static void
+setup_button_events(XWidget * button)
+{
+ button->events.expose=&expose;
+ button->events.configure=&configure;
+ button->events.key_press=NULL;
+ button->events.button_press=&button_press;
button->events.button_release=&button_release;
+}
static char *
setup_label(const char * command)
@@ -130,7 +134,7 @@
button=xsh->gui.last_widget;
button->data=data=malloc(sizeof(XSHButtonData));
data->label=setup_label(data->command=(char *)command);
- SETUP_BUTTON_EVENTS(button);
+ setup_button_events(button);
}
void
@@ -139,17 +143,14 @@
XShellGUILayout *layout=&(xsh->gui.layout);
xshell_floating_button_new(xsh, parent, command,
- XSH_WIDGET_WIDTH*(layout->column_count),
- XSH_WIDGET_HEIGHT*((layout->row_count =
- layout->row_count < layout->max_row_count
- ? layout->row_count+1:0)),
+ XSH_WIDGET_WIDTH*layout->column_count,
+ XSH_WIDGET_HEIGHT*layout->row_count,
XSH_WIDGET_WIDTH, XSH_WIDGET_HEIGHT);
-#ifdef DEBUG
- printf("layout->row_count: %d\nlayout->max_row_count: %d\n",
- layout->row_count, layout->max_row_count);
-#endif
- if(layout->row_count==0)
+ if(++(layout->row_count) > layout->max_row_count)
+ {
layout->column_count++;
+ layout->row_count=0;
+ }
}