[ghex] Use GDK symbolic names for button numbers
- From: Kalev Lember <klember src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ghex] Use GDK symbolic names for button numbers
- Date: Sun, 1 Apr 2012 19:43:20 +0000 (UTC)
commit 0cf069fa9d7626a6465a47a0fb78771f4026c31f
Author: Kalev Lember <kalevlember gmail com>
Date: Sun Apr 1 22:18:18 2012 +0300
Use GDK symbolic names for button numbers
src/gtkhex.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gtkhex.c b/src/gtkhex.c
index 7e48821..203eff0 100644
--- a/src/gtkhex.c
+++ b/src/gtkhex.c
@@ -1067,7 +1067,7 @@ static void hex_scroll_cb(GtkWidget *w, GdkEventScroll *event, GtkHex *gh) {
static void hex_button_cb(GtkWidget *w, GdkEventButton *event, GtkHex *gh) {
if( (event->type == GDK_BUTTON_RELEASE) &&
- (event->button == 1) ) {
+ (event->button == GDK_BUTTON_PRIMARY) ) {
if(gh->scroll_timeout != -1) {
g_source_remove(gh->scroll_timeout);
gh->scroll_timeout = -1;
@@ -1077,7 +1077,7 @@ static void hex_button_cb(GtkWidget *w, GdkEventButton *event, GtkHex *gh) {
gtk_grab_remove(w);
gh->button = 0;
}
- else if((event->type == GDK_BUTTON_PRESS) && (event->button == 1)) {
+ else if((event->type == GDK_BUTTON_PRESS) && (event->button == GDK_BUTTON_PRIMARY)) {
if (!gtk_widget_has_focus (GTK_WIDGET (gh)))
gtk_widget_grab_focus (GTK_WIDGET(gh));
@@ -1099,7 +1099,7 @@ static void hex_button_cb(GtkWidget *w, GdkEventButton *event, GtkHex *gh) {
show_cursor(gh);
}
}
- else if((event->type == GDK_BUTTON_PRESS) && (event->button == 2)) {
+ else if((event->type == GDK_BUTTON_PRESS) && (event->button == GDK_BUTTON_MIDDLE)) {
GtkHexClass *klass = GTK_HEX_CLASS(GTK_WIDGET_GET_CLASS(gh));
gchar *text;
@@ -1166,7 +1166,7 @@ static void ascii_scroll_cb(GtkWidget *w, GdkEventScroll *event, GtkHex *gh) {
static void ascii_button_cb(GtkWidget *w, GdkEventButton *event, GtkHex *gh) {
if( (event->type == GDK_BUTTON_RELEASE) &&
- (event->button == 1) ) {
+ (event->button == GDK_BUTTON_PRIMARY) ) {
if(gh->scroll_timeout != -1) {
g_source_remove(gh->scroll_timeout);
gh->scroll_timeout = -1;
@@ -1176,7 +1176,7 @@ static void ascii_button_cb(GtkWidget *w, GdkEventButton *event, GtkHex *gh) {
gtk_grab_remove(w);
gh->button = 0;
}
- else if( (event->type == GDK_BUTTON_PRESS) && (event->button == 1) ) {
+ else if( (event->type == GDK_BUTTON_PRESS) && (event->button == GDK_BUTTON_PRIMARY) ) {
if (!gtk_widget_has_focus (GTK_WIDGET (gh)))
gtk_widget_grab_focus (GTK_WIDGET(gh));
@@ -1195,7 +1195,7 @@ static void ascii_button_cb(GtkWidget *w, GdkEventButton *event, GtkHex *gh) {
show_cursor(gh);
}
}
- else if((event->type == GDK_BUTTON_PRESS) && (event->button == 2)) {
+ else if((event->type == GDK_BUTTON_PRESS) && (event->button == GDK_BUTTON_MIDDLE)) {
GtkHexClass *klass = GTK_HEX_CLASS(GTK_WIDGET_GET_CLASS(gh));
gchar *text;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]