Re: [gtk-list] gtk_widget_grab_default



On Thu, 10 Dec 1998, Alexander Kotelnikov wrote:

> Hi,
> I have not very but complex window with 3 boxes one in another and some
> widgets in them. QUIT button is in the inner box and I want it to be
> default.
> Before 
> gtk_widget_show(qbut); // QuitBUTton
> I insert:
>           GTK_WIDGET_SET_FLAGS(qbut,GTK_CAN_DEFAULT);
>           gtk_widget_grab_default(qbut);
> 
> but it gtk_widget_grab_default does not work at all -- button have ability
> to be default, but it is not default right after progrm runs, may be I
> need to do something more?

make sure you've added the button to its container already, and the container
is added to its parent already, etc, etc.. so gtk_widget_grab_default() gets
a chance to grab the default for this widget on the toplevel window.

> 
> Alexander Kotelnikov
> 

---
ciaoTJ



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