[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gEDA: x_multiatrib dialog: two small feature wishes
Hi Patrick and Werner,
>I've noticed two thing while playing with the dialog:
>
>* it would be nice if the escape keypress would close the window.
I attached a patch which does this, but it is hardly the most
elegant (ie hack) approach, but it does seem to work for me. Please take a
look at it, Patrick, and let me know what you think.
>* the window should stay in front of the gschem window.
On my box, the dialog box stays in front all the time. What
window manager are you using? (I'm using metacity)
>
>The dialog is quit impressive. Have you used a tool like glade to create
>it? The source looks much better than mine (glade 2.0.1)
>
Yeah, I spent some time looking at the source. Pretty nifty.
-Ales
Index: x_multiattrib.nw
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/x_multiattrib.nw,v
retrieving revision 1.21
diff -c -r1.21 x_multiattrib.nw
*** x_multiattrib.nw 28 Feb 2005 18:26:04 -0000 1.21
--- x_multiattrib.nw 6 Mar 2005 21:59:50 -0000
***************
*** 1116,1121 ****
--- 1116,1130 ----
{
Multiattrib *multiattrib = (Multiattrib*)user_data;
+ if (strcmp(gdk_keyval_name(event->keyval), "Escape") == 0) {
+ GtkDialog* dialog;
+ i_set_state (multiattrib->toplevel, SELECT);
+ i_update_toolbar (multiattrib->toplevel);
+ dialog = (GtkDialog*) gtk_widget_get_ancestor(widget, GTK_TYPE_DIALOG);
+ gtk_dialog_response((GtkDialog*)dialog, MULTIATTRIB_RESPONSE_CLOSE);
+ return TRUE;
+ }
+
if (event->state == 0 &&
(event->keyval == GDK_Delete || event->keyval == GDK_KP_Delete)) {
GtkTreeModel *model;