Re: Customizing balsa (scrolling while selecting)
- From: Philip Van Hoof <freax pandora be>
- To: balsa-list gnome org
- Subject: Re: Customizing balsa (scrolling while selecting)
- Date: Sat, 3 Nov 2001 12:52:03 +0100
On 2001.11.03 12:17 Philip Van Hoof wrote:
> Well.. I added the motion event to the whole widget (window->preview),
> maybe it's better to only add it to the textentry which contains the
> message body? (Ehm, but I can't find it in the source; heh :-\)
Argh, I am post-reply-reply'ing again :)
I found the entry-widget in window->preview at balsa-message.c
Remove the patch against main-window.c and patch balsa-message.c :)
So.. the scrollbar will have to move "up" when (y < 9) and
down when (y > (widgetheight-9)) .. remaining questions :
How to get the widgetheight (item in balsa-message.c) and
how to move the scrollbar up/down.
--
Philip van Hoof aka freax (http://www.freax.eu.org)
irc: irc.openprojects.net mailto:freax @ linux.be
--- balsa/src/balsa-message.c Thu Oct 18 11:47:29 2001
+++ balsa-freax/src/balsa-message.c Sat Nov 3 12:44:25 2001
@@ -131,6 +131,9 @@
static void balsa_gtk_text_size_request(GtkWidget * widget,
GtkRequisition * requisition,
gpointer data);
+static void balsa_gtk_text_motion (GtkWidget * widget,
+ GdkEventMotion * event,
+ gpointer data);
#ifdef HAVE_GTKHTML
static void balsa_gtk_html_size_request(GtkWidget * widget,
GtkRequisition * requisition,
@@ -1857,7 +1860,11 @@
(gpointer) bm);
gtk_signal_connect(GTK_OBJECT(item), "size_request",
(GtkSignalFunc)balsa_gtk_text_size_request,
- (gpointer) bm);
+ (gpointer) bm);
+ gtk_signal_connect(GTK_OBJECT(item), "motion_notify_event",
+ (GtkSignalFunc)(balsa_gtk_text_motion),
+ (gpointer) bm);
+
allocate_quote_colors(GTK_WIDGET(bm), balsa_app.quoted_color,
0, MAX_QUOTED_COLOR - 1);
@@ -2604,6 +2611,30 @@
return FALSE;
}
return TRUE;
+}
+
+
+static void
+balsa_gtk_text_motion (GtkWidget * widget, GdkEventMotion * event, gpointer data)
+{
+ GdkModifierType state;
+ GtkText *text;
+ int x, y;
+ g_return_if_fail(widget != NULL);
+ g_return_if_fail(GTK_IS_TEXT(widget));
+
+ text = GTK_TEXT(widget);
+
+ if (event->is_hint) {
+ gdk_window_get_pointer(event->window, &x, &y, &state);
+ } else {
+ x = (int) event->x;
+ y = (int) event->y;
+ state = (GdkModifierType) event->state;
+ }
+ if ((state & GDK_BUTTON1_MASK) || (state & GDK_BUTTON3_MASK)) {
+ g_print ("You are pressing and moving [%d, %d]\n", x, y);
+ }
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]