My vain attempts at getting Radio Buttons working properly -mig

This commit is contained in:
Miguel de Icaza 1998-04-16 04:22:56 +00:00
parent f494ada890
commit 482e8af0fb
3 changed files with 38 additions and 57 deletions

View File

@ -1,5 +1,8 @@
1998-04-15 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gwidget.c (remove_hotkey, x_create_radio): Radio buttons should
not display the special Hotkey specificator.
* gcmd.c (gnome_close_panel): Implement the close-the-panel
functionality.

View File

@ -61,11 +61,6 @@ General Comments
I think the thumb should follow in both cases. This is a gtk comment
I'm sure.
DONE - some dialogs only had a single entry box (like the ftp link one),
DONE when you hit return in the entrybox it would be nice if that mapped
DONE to hitting 'Ok' so you wouldnt have to hit Ok manually.
Panel comments
---------------
@ -81,12 +76,6 @@ Panel comments
know the string is truncated in that column. I think its a really nice
touch, but not a complete show stopper.
> - I take it the shaped-window DnD isnt working, obviously we want to have
> nice looking drag cursor behavior at some point.
=========> This works on my machine. When you start a drag from a file,
=========> or a group of files it should show a little icon. Same applies
=========> to dragging the desktop icons.
- the user needs some feedback that something is happening - for example,
on an ftp link, the cursor needs to change or a modal dialog popping
@ -95,30 +84,12 @@ Panel comments
- 'Compare panels' doesnt appear to do anything - i didnt see any feedback
after I chose the compare method.
> - No matter what the sort mode, the directories seem to always get listed
> first. Maybe this should be personal preference?
======> this is a setting. It is called mix files. If it is set, then you
======> get a mixed directory/file listing, if not, you get the directories first.
- Alt-t didnt seem to change the listing mode.
- the pull-downs on the entry boxes under the floating menubar dont
seem to do anything. I thought they might act as a history of the
last few directories visited or something.
DONE - a toobar with a 'back' type button would be handy - I realize the '..'
DONE folder does the same thing, but in a long file listing its nice to
DONE just have a button to do it.
DONE - I got several 'sigpipes' when trying to view a ftpfs file, or
DONE when trying to view RPM tags via the rpmfs.
DONE
DONE Open a RPM, then got into the INFO pseudo-dir, the VIEW a RPM tag. It
DONE will sigpipe.
DONE - is there a way to click and drag and select all the files you drag
DONE over? Sortof a interactive 'select group' option.
- the internal viewer, in hex mode, seems to shove the ASCII side of the
view (the rightmost column) off the side of the window.
@ -126,16 +97,6 @@ DONE over? Sortof a interactive 'select group' option.
- internal viewer - search should hilight the matching text
DONE - some files when I try to 'Open' them, it just does nothing. I'm
DONE guessing no association existed - if so it should tell me and let
DONE me create an association
DONE - I couldnt view files inside of a RPM which I was browsing via the ftpfs
DONE is this just cause I'm nuts to try?
DONE - it might be good to do a rescan after a panel accepts a drag event. Is
DONE that an option?
- I didnt get an error message when I tried to change the file modes
on a file I didnt own.
@ -151,15 +112,6 @@ DONE that an option?
Configure Options
-----------------
DONE - Buttons at bottom (Ok, Save, Cancel) - Save overlays the Ok button
DONE - the 'Pause after run' radio buttons - you can select 'on dumb Terminals'
DONE and Never at the same time, etc etc. I only one should be selectable
DONE at a time. I could get several combinations where multiple were selected.
DONE - no matter if I hit 'Ok' or 'Save', if I immediately reenter the Options
DONE dialog, the check buttons are all reset, ie. it didnt 'keep' my settings.
- need some sort of help for all these options, they aren't too intuitive.
We can't assume people are going to read the man page.
@ -179,9 +131,4 @@ VFS Options
of feedback while grabbing a ls listing from a ftp server would be
cool.
Internal Viewer
---------------
DONE - no vertical scrollbar!

View File

@ -152,13 +152,27 @@ x_radio_focus_item (WRadio *radio)
}
}
void
x_radio_toggle (WRadio *radio)
{
GList *children = GTK_BOX (radio->widget.wdata)->children;
int i;
for (i = 0; i < radio->count; i++){
GtkBoxChild *bc = (GtkBoxChild *) children->data;
if (GTK_TOGGLE_BUTTON (bc->widget)->active)
gtk_toggle_button_toggled
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (bc->widget), (i == radio->sel) ? 1 : 0);
children = children->next;
}
}
static void
radio_toggle (GtkObject *object, WRadio *r)
{
int idx = (int) gtk_object_get_data (object, "index");
printf ("WEEEEE RADIO!\n");
if (!GTK_TOGGLE_BUTTON (object)->active)
return;
@ -167,6 +181,18 @@ radio_toggle (GtkObject *object, WRadio *r)
r->sel = idx;
}
static char *
remove_hotkey (char *text)
{
char *t = g_strdup (text);
char *p = strchr (t,'&');
if (p)
strcpy (p, p+1);
return t;
}
int
x_create_radio (Dlg_head *h, widget_data parent, WRadio *r)
{
@ -176,12 +202,16 @@ x_create_radio (Dlg_head *h, widget_data parent, WRadio *r)
vbox = gtk_vbox_new (0, 0);
for (i = 0; i < r->count; i++){
char *text = remove_hotkey (_(r->texts [i]));
if (i == 0){
w = gtk_radio_button_new_with_label (NULL, r->texts [i]);
w = gtk_radio_button_new_with_label (NULL, text);
group = gtk_radio_button_group (GTK_RADIO_BUTTON (w));
r->first_gtk_radio = w;
} else {
w = gtk_radio_button_new_with_label (group, r->texts [i]);
w = gtk_radio_button_new_with_label (group, text);
}
g_free (text);
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (w), (i == r->sel));
gtk_signal_connect (GTK_OBJECT (w), "toggled", GTK_SIGNAL_FUNC (radio_toggle), r);
gtk_object_set_data (GTK_OBJECT (w), "index", (void *) (i+1));
@ -190,6 +220,7 @@ x_create_radio (Dlg_head *h, widget_data parent, WRadio *r)
gtk_widget_show_all (vbox);
r->widget.wdata = (widget_data) vbox;
return 1;
}