summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1fdf26e)
raw | patch | inline | side by side (parent: 1fdf26e)
author | Eric Wertz <ericdwertz@gmail.com> | |
Fri, 12 Jan 2018 15:42:44 +0000 (10:42 -0500) | ||
committer | Eric Wertz <ericdwertz@gmail.com> | |
Fri, 12 Jan 2018 15:42:44 +0000 (10:42 -0500) |
main.c | patch | blob | history |
index cdf212f377c8ea18014dfe3cc9c7299807e76209..ef9cc8acd45dc7ab855ca786aad1d751b8f078f0 100755 (executable)
--- a/main.c
+++ b/main.c
cairo_fill(cr);
- return FALSE;
+ return TRUE;
}
static gboolean draw_entry( GtkWidget* widget, cairo_t* cr, gpointer user_data )
char buffer[250];
sprintf(buffer,"%s &",icon->launch_command);
+ printf( "%s \n", buffer );
system(buffer);
gtk_main_quit();
icon->x=icon_layout_x;
icon->y=icon_layout_y;
- icon->area = gtk_drawing_area_new();
+ icon->area = gtk_button_new();
gtk_widget_set_size_request( icon->area, ICON_SIZE*1.25, ICON_SIZE*1.25 );
gtk_widget_add_events( icon->area, GDK_POINTER_MOTION_MASK
| GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK );
+ gtk_widget_set_app_paintable( icon->area, TRUE );
g_signal_connect( G_OBJECT( icon->area ), "draw", G_CALLBACK( draw_app_icon ), (void*)icon );
g_signal_connect( G_OBJECT( icon->area ), "enter-notify-event", G_CALLBACK(icon_mouse_enter), (void*)icon );
g_signal_connect( G_OBJECT( icon->area ), "leave-notify-event", G_CALLBACK(icon_mouse_leave), (void*)icon );
g_signal_connect( G_OBJECT( icon->area ), "motion-notify-event", G_CALLBACK(icon_mouse_move), (void*)icon );
- g_signal_connect( G_OBJECT( icon->area ), "button-release-event", G_CALLBACK(icon_button_release), (void*)icon );
+ g_signal_connect( G_OBJECT( icon->area ), "clicked", G_CALLBACK(icon_button_release), (void*)icon );
pango_layout_set_alignment( icon->layout, PANGO_ALIGN_CENTER );
pango_layout_set_width( icon->layout, (int)(ICON_SIZE*0.99) * PANGO_SCALE );
WINDOW_HEIGHT=height;
}
-gboolean entry_lose_focus(GtkWidget* widget,GdkEvent* event, gpointer user)
-{
- gtk_main_quit();
- return TRUE;
-}
-
//Command line arguments
// -w is windowed mode
// -p X Y is windowed mode position
gtk_widget_add_events( window->window, GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK );
g_signal_connect( G_OBJECT( window->window ), "key-press-event", G_CALLBACK(window_key_press), NULL);
+ g_signal_connect( G_OBJECT( window->window ), "focus-out-event", G_CALLBACK(gtk_main_quit), NULL );
gtk_widget_set_size_request(window->window,WINDOW_WIDTH,WINDOW_HEIGHT);
ICON_SIZE = SCALE_VALUE(ICON_SIZE);
gtk_widget_set_size_request(entry,WINDOW_WIDTH-ICON_SIZE/2,ICON_SIZE);
//gtk_widget_set_app_paintable(entry, TRUE);
g_signal_connect(G_OBJECT(entry), "draw", G_CALLBACK(draw_entry), NULL);
- g_signal_connect(G_OBJECT(entry), "focus-out-event", G_CALLBACK(entry_lose_focus), NULL);
GtkWidget* scrollable = gtk_scrolled_window_new( NULL, NULL );
gtk_widget_add_events( scrollable, GDK_BUTTON_RELEASE_MASK );