Permalink
Browse files

Merge pull request #8 from pblaszczyk/master

Use GtkDialog instead of GtkWindow
  • Loading branch information...
2 parents 98b6969 + c91a6de commit f24ca50269e11a52747f192e379164998db7ba06 @rtyler committed Sep 12, 2013
Showing with 24 additions and 19 deletions.
  1. +9 −0 configure.in
  2. +15 −19 src/main.cc
View
@@ -50,6 +50,15 @@ AC_CHECK_FUNC( poptGetContext,
)
)
+AC_CHECK_FUNC( XQueryPointer,
+ ,
+ AC_CHECK_LIB(X11,
+ XQueryPointer,
+ LIBS="${LIBS} -lX11",
+ echo "*** You need to get libX11 ***";exit
+ )
+ )
+
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.0.4
gobject-2.0 >= 2.0.4
gthread-2.0 >= 2.0.4)
View
@@ -697,7 +697,7 @@ gmrun_gtk_window_place_at(GtkWindow *window,
int main(int argc, char **argv)
{
- GtkWidget *win;
+ GtkWidget *dialog;
GtkWidget *compline;
GtkWidget *label_search;
struct gigi g;
@@ -708,24 +708,20 @@ int main(int argc, char **argv)
gtk_init(&argc, &argv);
- win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_widget_realize(win);
- gdk_window_set_decorations(win->window, GDK_DECOR_BORDER);
- gtk_widget_set_name(win, "Msh_Run_Window");
- gtk_window_set_title(GTK_WINDOW(win), "Execute program feat. completion");
- gtk_window_set_policy(GTK_WINDOW(win), FALSE, FALSE, TRUE);
+ dialog = gtk_dialog_new();
+ gtk_widget_realize(dialog);
+ gdk_window_set_decorations(dialog->window, GDK_DECOR_BORDER);
+ gtk_widget_set_name(dialog, "Msh_Run_Window");
+ gtk_window_set_title(GTK_WINDOW(dialog), "Execute program feat. completion");
+ gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
// gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
- gtk_container_set_border_width(GTK_CONTAINER(win), 4);
- gtk_signal_connect(GTK_OBJECT(win), "destroy",
+ gtk_container_set_border_width(GTK_CONTAINER(dialog), 4);
+ gtk_signal_connect(GTK_OBJECT(dialog), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
- GtkWidget *hbox = gtk_vbox_new(FALSE, 2);
- gtk_widget_show(hbox);
- gtk_container_add(GTK_CONTAINER(win), hbox);
-
GtkWidget *hhbox = gtk_hbox_new(FALSE, 2);
gtk_widget_show(hhbox);
- gtk_box_pack_start(GTK_BOX(hbox), hhbox, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), hhbox, FALSE, FALSE, 0);
GtkWidget *label = gtk_label_new("Run program:");
gtk_widget_show(label);
@@ -792,7 +788,7 @@ int main(int argc, char **argv)
gtk_completion_line_last_history_item(GTK_COMPLETION_LINE(compline));
}
- gtk_box_pack_start(GTK_BOX(hbox), compline, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), compline, TRUE, TRUE, 0);
int prefs_top = 80;
int prefs_left = 100;
@@ -827,22 +823,22 @@ int main(int argc, char **argv)
if (strcmp (geoptr, ""))
{
- geo_parsed = gtk_window_parse_geometry (GTK_WINDOW (win),
+ geo_parsed = gtk_window_parse_geometry (GTK_WINDOW (dialog),
geoptr);
}
else
{
- gmrun_gtk_window_place_at(GTK_WINDOW(win),
+ gmrun_gtk_window_place_at(GTK_WINDOW(dialog),
prefs_left,
prefs_top,
prefs_centred_by_width,
prefs_centred_by_height,
prefs_use_active_monitor);
}
- gtk_widget_show(win);
+ gtk_widget_show(dialog);
- gtk_window_set_focus(GTK_WINDOW(win), compline);
+ gtk_window_set_focus(GTK_WINDOW(dialog), compline);
gtk_main();
}

0 comments on commit f24ca50

Please sign in to comment.