Hi List!
I've recently checked in the solution described in the last mail.
We now have a new function dlg_button_row_new() with a variable number
of arguments.
This function will make a button row containing the requested buttons to
be used in a dialog.
Here is a code snippet to get an idea how to use it:
/* Button row */
bbox = dlg_button_row_new(GTK_STOCK_OK, GTK_STOCK_CANCEL, NULL);
gtk_container_add(GTK_CONTAINER(main_vbox), bbox);
gtk_widget_show(bbox);
ok_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_OK);
SIGNAL_CONNECT(ok_bt, "clicked", goto_frame_ok_cb, goto_frame_w);
gtk_widget_grab_default(ok_bt);
cancel_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CANCEL);
SIGNAL_CONNECT(cancel_bt, "clicked", goto_frame_close_cb, goto_frame_w);
That's all need to be done for a dialog box button row!
The function will automatically make the layout corresponding to the
GTK1/2 environment,
the sequence of the id's when calling the function have no effect to the
layout.
To be able to do this, the function must know all kind of buttons to be
used.
Some rare dialogs using nonstandard buttons (e.g. the follow TCP stream
dialog), this will make trouble here.
In this case, the method can not be used at the moment.
I have changed the button row implementation in many of the dialogs, so
a lot of the files in the gtk dir has changed.
I might have introduced new bugs :-(
Regards, ULFL
--- Begin Message ---
Hi List!
As discussed earlier on this list, there is a difference in the layout
of the standard dialog "bottom button row",
caused by different styleguide suggestions for GTK1 and 2 I think.
Two things on this topic, which should be solved:
a.) GTK 1 / 2 differences
Example, when having "OK" and "Cancel" buttons in a dialog:
In GTK1, the "OK" button will be left and the "Cancel" button will be right
In GTK2 the "OK" button will be *right* and the "Cancel" button will be
*left*
b.) various button layouts for the same buttons
While working on the stock icons, I realized that the layout of the
button row is a lot different for different dialogs.
E.g.: Sometimes a single "Close" button is in the middle of the dialog
(IMHO ok), but sometimes on the right.
Proposal to solve both:
Implement a new function which will get a list of (named?) buttons to
display, and returns a widget including this buttons.
This will solve:
a.) the GTK1 / 2 difference, as the layout can be switched at a central
point
b.) different layouts for the same button "pile", as the function can
decide how the buttons should be layouted
I have to think about a simple and effective parameter profile for this
new function.
This might not be a solution for really all dialogs (as some of the
statistics dialogs have *very* different buttons),
but should be a good step in the right direction.
Any comments on this?
Regards, ULFL
--- End Message ---