ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [ethereal-dev] misc. suggestions for go to frame

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Nathan Neulinger <nneul@xxxxxxx>
Date: Sun, 05 Dec 1999 18:19:40 -0600
Guy Harris wrote:
> 
> > go to frame - add a shortcut
> 
> "Shortcut" as in "accelerator", e.g. control-G, which isn't taken yet?
> 
> I'll check that in.
> 
> > go to frame - take focus in entry area when bringing up window

gtk_widget_grab_focus(entrywidget);

> > go to frame - accept 'enter/return' as submitting the request
> 
> Isn't GTK+ wonderful?  I'll have to check into what needs to be done to
> make it do that, assuming the mere presence of an entry area renders it
> incapable of treating <Enter> as meaning "activate the default button"
> even if you're in a GtkEntry widget rather than a GtkText widget (where
> <Enter> has to mean "insert a newline").

        gtk_signal_connect(GTK_OBJECT(scw->entry_msg), "activate",
                GTK_SIGNAL_FUNC(startchat_callback), (gpointer) scw);

I use that in gtkyahoo.

> (It'd be even more wonderful if it could be arranged that <Esc> means
> "activate the Cancel button of a dialog box" in GTK+; given that <Esc>F
> does *NOT* appear to mean "next word" in that GtkEntry widget, this
> presumably isn't another consequence of trying to provide EMACS-like key
> bindings, as UNIX Netscape's use of <Alt>+{C,V,X} instead of
> <Ctrl>+{C,V,X} and *lack* of use of <Alt> to introduce a mnemonic to
> e.g. pop up menus from the menu bar apparently is.)

You probably just need to add a event handler for the keypress event and
trap it if it's escape.

> You can, at least, tab to the entry area to give it the focus, and then
> tab out of the entry area to give the "OK" button the focus, and hit
> <Enter> then.  Far from idea, but at least you can get *something* done
> from the keyboard.
> 
> (And don't get me started on Motif/GTK+ option menus; Windows uses
> "non-editable combo box" for those, meaning you can actually select an
> item with the keyboard, but, unless I haven't learned the Magic Trick
> for that, there's no way to control an option menu from the keyboard.
> It's at time annoying that UNIX, home of folks who like keyboards, often
> doesn't do as good a job as does Windows as letting you drive a GUI from
> the keyboard....

You're supposed to be able to use the arrows in gtk+ combo boxes to
select items, and it works just fine for me with gtkyahoo. In ethereal
though, for some reason, if you're at the top item, up arrow takes you
to the previous item on the page, similar for the bottom item, but other
than that, you can switch between them. Now, if you are referring to
typing letters, you'd have to make the combo box uneditable (there is a
gtk function to do that if I remember correctly).

> And then there's the joy of a Really Long Option Menu, which involves
> cascading menus, which are sometimes hyper-sensitive, and really hard to
> select from; at least a non-editable combo box drops down a scroll bar.
> One should avoid those, but if you work at a company whose Web form for
> requesting vacation time has, both for employeee and manager names, a
> big selectable list of *every single employee in the company*, and that
> company has recently hired its *thousandth* employee, you get stuck with
> Really Long Option Menus if you try using UNIX Netscape for that form,
> and you find yourself grateful that you don't happen to be running UNIX
> on your desktop....)

Ick, no kidding. That does suck, at least if you could do hierarchical
menus with web forms you could do something about that. (You could rig
something with javascript probably, but yuck.)

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@xxxxxxx
University of Missouri - Rolla         Phone: (573) 341-4841
Computing Services                       Fax: (573) 341-4216