[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
entries in radio buttons & lockups
- From: Walter Hofmann <Walter Hofmann physik stud uni-erlangen de>
- To: gtk-app-devel-list redhat com
- Subject: entries in radio buttons & lockups
- Date: Sun, 20 Jun 1999 16:57:13 +0200 (MEST)
-----BEGIN PGP SIGNED MESSAGE-----
I'm trying to create a dialog with gtk where the user can select one of
two modes with two radio buttons and then enter a parameter for the
selected mode.
I used two radio buttons and attached a hbox to each. The hbox contains
two labels and an entry each:
x Label ____ Label.
o another Label ____ Label.
The problem now is that one cannot select the entry with mouse or
keyboard, as it is completely surrounded by the highlight area of the
respective radio button, and the gtk event handlers don't seem to work
right in such a situation.
I then tried to work around this by creating a handler for the "toggled"
signal and setting "can_focus" to FALSE for the selected radio button (it
also selects the entry and makes the other entry un-sensitive):
void handle_toggled (GtkToggleButton *togglebutton, gpointer user_data)
{
if (togglebutton==GTK_TOGGLE_BUTTON (all_button))
{
gtk_widget_set (group_button, "can_focus", TRUE, NULL);
gtk_widget_set (times_entry, "sensitive", TRUE, NULL);
gtk_widget_grab_focus (times_entry);
gtk_widget_set (all_button, "can_focus", FALSE, NULL);
gtk_widget_set (group_entry, "sensitive", FALSE, NULL);
}
else
{
gtk_widget_set (all_button, "can_focus", TRUE, NULL);
gtk_widget_set (group_entry, "sensitive", TRUE, NULL);
gtk_widget_grab_focus (group_entry);
gtk_widget_set (group_button, "can_focus", FALSE, NULL);
gtk_widget_set (times_entry, "sensitive", FALSE, NULL);
}
}
This seems to work most of the time. However, sometimes gtk seems to lock
up: The (keyboard-)cursor is in one of the entries and one can insert end
edit, but clicking with the mouse on any element in the window or any
other application window doesn't do anything. Changing the focus with the
keyboard of clicking on the focused entry again seems to clear this
effect. The problem occurs whenever text in one of the entries is selected
and I click on another widget in the window. Any hints why this happens?
(I'm using gtk 1.2.2)
Walter
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
Charset: noconv
iQCVAwUBN20BTfzeA3/eVHOFAQG+ZwP/R74T0aVt/TK5wRNJ7kXOhqZbPUS3WjNn
m14Dd/YHbp3I6mNoZZ6ctcC/gXQOBjlqzHkksvcFnWD+9CTQpwllaQo2Jetf+pX3
ItIpKTngLEsp9rPY5aPzPQ9FoeP0ypeksUTjFGAdMRlFih59pYaL9fVGXygSFMTc
kZcVJt/B4Y0=
=4v4l
-----END PGP SIGNATURE-----
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]