Re: activating a button
- From: "Chandrashekhar V. Joshi" <cvj telco co in>
- To: Jonathan Blandford <jrb redhat com>
- Cc: Davina Armstrong <davina lickey com>,	gtk-app-devel-list gnome org, gtk-list gnome org
- Subject: Re: activating a button
- Date: Wed, 1 Nov 2000 10:46:32 +0000
On Nov 1,  1:12am, Jonathan Blandford wrote:
> Subject: Re: activating a button
> "Chandrashekhar V. Joshi" <cvj telco co in> writes:
>
> > On Oct 31,  4:49pm, Jonathan Blandford wrote:
> > > Subject: Re: activating a button
> > > Davina Armstrong <davina lickey com> writes:
> > >
> > > > When I hit Enter, the GtkEntry "activate" event is triggered.  I can
> > > > either make the "activate" event call my button callback function, or I
> > > > can make it call gtk_button_clicked(button), both of which work, but
> > > > fail to give the user the visual feedback of the button being clicked.
> > > > Can anyone tell me how to accomplish this?
> > >
> >
> > 	Try gtk_button_pressed(button) and then
> > 	gtk_button_realesed(button)
> > 	this will ultimately generate the click event on your button
> > 	also hopefully( i m not sure plz. try out )
> > 	it will give you the visual effect
>
> This won't work.  It will simulate the "clicked" event (by emitting the
> signal) but you won't get the visual effect.  You are better off using
> gtk_button_clicked, or better yet, just calling your callback directly
> when you get an "activate" signal.
>
	oh yes. actually u can emit a button_press and button_release signal
	but following should work except that queue_draw may not update
	your ui as u are in the event dispatch thread till ur function
	completes
	gtk_widget_set_state (GTK_WIDGET (button), GTK_STATE_NORMAL);
	gtk_widget_queue_draw (GTK_WIDGET (button));
	// ur implementation here
	gtk_widget_set_state (GTK_WIDGET (button), GTK_STATE_NORMAL);
	gtk_widget_queue_draw (GTK_WIDGET (button));
thanx
cvjoshi
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]