Re: [gtk-list] specialized timeout



>  I'm attempting to create a function which will pause for some given amount
>  of time, or until some event is received (like the user pressing a key).
>  The use for this is doing parenthesis matching ala emacs where you pause up
>  to a second unless a key is pressed.  Since the text widget needs to have its
>  point moved back to the end paren that was just entered before inserting any
>  more keys, I need this timeout function to run outside of the gtk_main()
>  loop.  Can anyone suggest a strategy?

You do not need to exit the main loop.  Just install a timeout
function with gtk_timeout_add().  Before you install it, save the
position of the point.  In your timeout handler, do whatever you need
to do.  And in your keystroke handler, remove the timeout handler if
it exists.

  Federico



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