Re: [gtk-list] Text Entries



Gregory Saunders wrote:
> Hi,
> 
>   I'm trying to write a program in which the user types something (i.e. a
> command) in a text entry and then it does something. What I want to be able to
> do is trigger some event when the user presses the 'enter' key. I can't see a
> way of doing this with text entries though. Is there a way, or should I be
> using something else?

I did it this way, but it might not be the "right way". But until there's more
documentation....

void entry_insert(GtkWidget *widget, GdkEventKey *key)
{
        char buf[2];
        if (key->keyval != XK_Return)
                return;

[....]

        bottext = gtk_entry_new();
        gtk_signal_connect(GTK_OBJECT(bottext), "key_press_event",
                (GtkSignalFunc)entry_insert,NULL);


  - Craig



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]