Re: [gtk-list] Re: multi-tasking



On 22 Feb 1998, Owen Taylor wrote:

> Well, you should most likely actually be only setting the down
> pixmap in the "button_press_event" callback. The actual triggering
> should be on the "clicked" event. (Try fooling around some with
> how a button triggers) If you unset your pixmap in the
> "button_release_event", then that won't be displayed until your
> command finishes, but that may be the right effect. 

  Well, I was using a EventBox for each of the buttons, but apparently it
doesn't have a "clicked" event, so I've switched back to a button. The
reason I wasn't using a button is the border that is placed around the
pixmap -- is there a way to turn this off in butons?

  Now I have a problem where it sigsegv's on me when I press the button.
It is related to the clicked event because I have tried removing all other
events related to the button, also it isn't the clicked routine being
called because the routine is successfully called when attached to a
pressed or unpressed event! The other event, when on, all work.

  Does this sound like a bug or am I doing something else wrong? I'm using
GTK+ v0.99.3

> 
> But as of 0.99.4, you should be able to say, in the beginning
> of your "clicked" routine:
> 
>   while (gtk_events_pending())
>     gtk_main_iteration();

  It looks like using the "clicked" event, when I can get it to work, it a
cleaner way of doing it.

> If you actually _want_ a button that triggers when the thing is
> pressed. (Say you are implementing the typical CD "scan through
> track when >> is held down") then this might be a good thing to do -
> you can get autorepeat behavior in the bargain.

  That sounds like a good idea, I'd have to fake the advancement until the
mouse is released (moving to the next track takes about a second for some
reason), but that could be a pretty cool feature.

  Brian

======================================================================
Nexus Computing                           http://www.eskimo.com/~nexus
Electronics, Embedded Software and Linux             nexus@tatoosh.com



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