* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <config.h>
+#include "config.h"
#include <gtk/gtk.h>
-#include <gtk/gtkstock.h>
-#include <gdk/gdk.h>
gchar *screen2_name = NULL;
GtkWidget * other_entry)
{
GtkWidget *window, *vbox;
+ GtkWidget *content_area;
MyDoubleGtkEntry *double_entry = g_new (MyDoubleGtkEntry, 1);
double_entry->e1 = GTK_ENTRY (entry);
double_entry->e2 = GTK_ENTRY (other_entry);
if (!screen)
screen = gdk_screen_get_default ();
- window = gtk_widget_new (GTK_TYPE_DIALOG,
+ window = g_object_new (GTK_TYPE_DIALOG,
"screen", screen,
"user_data", NULL,
"type", GTK_WINDOW_TOPLEVEL,
g_signal_connect (window, "destroy",
G_CALLBACK (gtk_main_quit), NULL);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (window));
- vbox = gtk_widget_new (GTK_TYPE_VBOX,
+ vbox = g_object_new (GTK_TYPE_BOX,
"border_width", 5,
+ "orientation", GTK_ORIENTATION_VERTICAL,
NULL);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
gtk_widget_grab_focus (entry);
{
GtkWidget *dialog, *display_entry, *dialog_label;
GtkWidget *entry, *entry2;
+ GtkWidget *content_area;
GdkDisplay *dpy2;
GdkScreen *scr2 = NULL; /* Quiet GCC */
gboolean correct_second_display = FALSE;
dialog_label =
gtk_label_new ("Please enter the name of\nthe second display\n");
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog_label);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
- display_entry);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+
+ gtk_container_add (GTK_CONTAINER (content_area), dialog_label);
+ gtk_container_add (GTK_CONTAINER (content_area), display_entry);
g_signal_connect (dialog, "response",
G_CALLBACK (get_screen_response), display_entry);
gtk_widget_grab_focus (display_entry);
- gtk_widget_show_all (GTK_BIN (dialog)->child);
+ gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (dialog)));
while (!correct_second_display)
{
gtk_widget_destroy (dialog);
- entry = gtk_widget_new (GTK_TYPE_ENTRY,
+ entry = g_object_new (GTK_TYPE_ENTRY,
"activates_default", TRUE,
"visible", TRUE,
NULL);
- entry2 = gtk_widget_new (GTK_TYPE_ENTRY,
+ entry2 = g_object_new (GTK_TYPE_ENTRY,
"activates_default", TRUE,
"visible", TRUE,
NULL);