It compiles. Now I will add the toolbar example to testgtk.c - Federico

This commit is contained in:
Arturo Espinosa 1997-12-22 21:32:24 +00:00
parent 162795e983
commit 0a81bbf58f
3 changed files with 64 additions and 53 deletions

View File

@ -58,11 +58,13 @@ POST_UNINSTALL = true
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
CPP = @CPP@
LD = @LD@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
NM = @NM@
PACKAGE = @PACKAGE@
RANLIB = @RANLIB@
VERSION = @VERSION@
@ -101,6 +103,7 @@ libgtk_la_SOURCES = \
gtkframe.c \
gtkgamma.c \
gtkgc.c \
gtkhandlebox.c \
gtkhbbox.c \
gtkhbox.c \
gtkhpaned.c \
@ -143,6 +146,7 @@ libgtk_la_SOURCES = \
gtktable.c \
gtktext.c \
gtktogglebutton.c \
gtktoolbar.c \
gtktooltips.c \
gtktree.c \
gtktreeitem.c \
@ -229,6 +233,7 @@ gtkinclude_HEADERS = \
gtktable.h \
gtktext.h \
gtktogglebutton.h \
gtktoolbar.h \
gtktooltips.h \
gtktree.h \
gtktreeitem.h \
@ -338,19 +343,19 @@ gtkaspectframe.lo gtkalignment.lo gtkarrow.lo gtkbin.lo gtkbbox.lo \
gtkbox.lo gtkbutton.lo gtkcheckbutton.lo gtkcheckmenuitem.lo \
gtkcolorsel.lo gtkcontainer.lo gtkcurve.lo gtkdata.lo gtkdialog.lo \
gtkdrawingarea.lo gtkentry.lo gtkeventbox.lo gtkfilesel.lo gtkfixed.lo \
gtkframe.lo gtkgamma.lo gtkgc.lo gtkhbbox.lo gtkhbox.lo gtkhpaned.lo \
gtkhruler.lo gtkhscale.lo gtkhscrollbar.lo gtkhseparator.lo gtkimage.lo \
gtkinputdialog.lo gtkitem.lo gtklabel.lo gtklist.lo gtklistitem.lo \
gtkmain.lo gtkmenu.lo gtkmenubar.lo gtkmenufactory.lo gtkmenuitem.lo \
gtkmenushell.lo gtkmisc.lo gtknotebook.lo gtkobject.lo gtkoptionmenu.lo \
gtkpaned.lo gtkpixmap.lo gtkpreview.lo gtkprogressbar.lo \
gtkradiobutton.lo gtkradiomenuitem.lo gtkrange.lo gtkrc.lo gtkruler.lo \
gtkscale.lo gtkscrollbar.lo gtkscrolledwindow.lo gtkselection.lo \
gtkseparator.lo gtksignal.lo gtkstyle.lo gtktable.lo gtktext.lo \
gtktogglebutton.lo gtktooltips.lo gtktree.lo gtktreeitem.lo \
gtktypeutils.lo gtkvbbox.lo gtkvbox.lo gtkviewport.lo gtkvpaned.lo \
gtkvruler.lo gtkvscale.lo gtkvscrollbar.lo gtkvseparator.lo \
gtkwidget.lo gtkwindow.lo fnmatch.lo
gtkframe.lo gtkgamma.lo gtkgc.lo gtkhandlebox.lo gtkhbbox.lo gtkhbox.lo \
gtkhpaned.lo gtkhruler.lo gtkhscale.lo gtkhscrollbar.lo \
gtkhseparator.lo gtkimage.lo gtkinputdialog.lo gtkitem.lo gtklabel.lo \
gtklist.lo gtklistitem.lo gtkmain.lo gtkmenu.lo gtkmenubar.lo \
gtkmenufactory.lo gtkmenuitem.lo gtkmenushell.lo gtkmisc.lo \
gtknotebook.lo gtkobject.lo gtkoptionmenu.lo gtkpaned.lo gtkpixmap.lo \
gtkpreview.lo gtkprogressbar.lo gtkradiobutton.lo gtkradiomenuitem.lo \
gtkrange.lo gtkrc.lo gtkruler.lo gtkscale.lo gtkscrollbar.lo \
gtkscrolledwindow.lo gtkselection.lo gtkseparator.lo gtksignal.lo \
gtkstyle.lo gtktable.lo gtktext.lo gtktogglebutton.lo gtktoolbar.lo \
gtktooltips.lo gtktree.lo gtktreeitem.lo gtktypeutils.lo gtkvbbox.lo \
gtkvbox.lo gtkviewport.lo gtkvpaned.lo gtkvruler.lo gtkvscale.lo \
gtkvscrollbar.lo gtkvseparator.lo gtkwidget.lo gtkwindow.lo fnmatch.lo
PROGRAMS = $(noinst_PROGRAMS)
testgtk_SOURCES = testgtk.c
@ -389,25 +394,26 @@ DEP_FILES = .deps/fnmatch.P .deps/gtkaccelerator.P \
.deps/gtkdata.P .deps/gtkdialog.P .deps/gtkdrawingarea.P \
.deps/gtkentry.P .deps/gtkeventbox.P .deps/gtkfilesel.P \
.deps/gtkfixed.P .deps/gtkframe.P .deps/gtkgamma.P .deps/gtkgc.P \
.deps/gtkhbbox.P .deps/gtkhbox.P .deps/gtkhpaned.P .deps/gtkhruler.P \
.deps/gtkhscale.P .deps/gtkhscrollbar.P .deps/gtkhseparator.P \
.deps/gtkimage.P .deps/gtkinputdialog.P .deps/gtkitem.P \
.deps/gtklabel.P .deps/gtklist.P .deps/gtklistitem.P .deps/gtkmain.P \
.deps/gtkmenu.P .deps/gtkmenubar.P .deps/gtkmenufactory.P \
.deps/gtkmenuitem.P .deps/gtkmenushell.P .deps/gtkmisc.P \
.deps/gtknotebook.P .deps/gtkobject.P .deps/gtkoptionmenu.P \
.deps/gtkpaned.P .deps/gtkpixmap.P .deps/gtkpreview.P \
.deps/gtkprogressbar.P .deps/gtkradiobutton.P .deps/gtkradiomenuitem.P \
.deps/gtkrange.P .deps/gtkrc.P .deps/gtkruler.P .deps/gtkscale.P \
.deps/gtkscrollbar.P .deps/gtkscrolledwindow.P .deps/gtkselection.P \
.deps/gtkseparator.P .deps/gtksignal.P .deps/gtkstyle.P \
.deps/gtktable.P .deps/gtktext.P .deps/gtktogglebutton.P \
.deps/gtktooltips.P .deps/gtktree.P .deps/gtktreeitem.P \
.deps/gtktypeutils.P .deps/gtkvbbox.P .deps/gtkvbox.P \
.deps/gtkviewport.P .deps/gtkvpaned.P .deps/gtkvruler.P \
.deps/gtkvscale.P .deps/gtkvscrollbar.P .deps/gtkvseparator.P \
.deps/gtkwidget.P .deps/gtkwindow.P .deps/simple.P .deps/testgtk.P \
.deps/testinput.P .deps/testselection.P .deps/testtree.P
.deps/gtkhandlebox.P .deps/gtkhbbox.P .deps/gtkhbox.P .deps/gtkhpaned.P \
.deps/gtkhruler.P .deps/gtkhscale.P .deps/gtkhscrollbar.P \
.deps/gtkhseparator.P .deps/gtkimage.P .deps/gtkinputdialog.P \
.deps/gtkitem.P .deps/gtklabel.P .deps/gtklist.P .deps/gtklistitem.P \
.deps/gtkmain.P .deps/gtkmenu.P .deps/gtkmenubar.P \
.deps/gtkmenufactory.P .deps/gtkmenuitem.P .deps/gtkmenushell.P \
.deps/gtkmisc.P .deps/gtknotebook.P .deps/gtkobject.P \
.deps/gtkoptionmenu.P .deps/gtkpaned.P .deps/gtkpixmap.P \
.deps/gtkpreview.P .deps/gtkprogressbar.P .deps/gtkradiobutton.P \
.deps/gtkradiomenuitem.P .deps/gtkrange.P .deps/gtkrc.P \
.deps/gtkruler.P .deps/gtkscale.P .deps/gtkscrollbar.P \
.deps/gtkscrolledwindow.P .deps/gtkselection.P .deps/gtkseparator.P \
.deps/gtksignal.P .deps/gtkstyle.P .deps/gtktable.P .deps/gtktext.P \
.deps/gtktogglebutton.P .deps/gtktoolbar.P .deps/gtktooltips.P \
.deps/gtktree.P .deps/gtktreeitem.P .deps/gtktypeutils.P \
.deps/gtkvbbox.P .deps/gtkvbox.P .deps/gtkviewport.P .deps/gtkvpaned.P \
.deps/gtkvruler.P .deps/gtkvscale.P .deps/gtkvscrollbar.P \
.deps/gtkvseparator.P .deps/gtkwidget.P .deps/gtkwindow.P \
.deps/simple.P .deps/testgtk.P .deps/testinput.P .deps/testselection.P \
.deps/testtree.P
SOURCES = $(libgtk_la_SOURCES) testgtk.c testinput.c testselection.c simple.c testtree.c
OBJECTS = $(libgtk_la_OBJECTS) testgtk.o testinput.o testselection.o simple.o testtree.o

View File

@ -17,6 +17,9 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "gtkbutton.h"
#include "gtklabel.h"
#include "gtkvbox.h"
#include "gtktoolbar.h"
@ -114,6 +117,8 @@ gtk_toolbar_new(GtkOrientation orientation,
toolbar->orientation = orientation;
toolbar->style = style;
return GTK_WIDGET(toolbar);
}
@ -122,7 +127,7 @@ gtk_toolbar_destroy(GtkObject *object)
{
GtkToolbar *toolbar;
GList *children;
GtkWidget *child;
Child *child;
g_return_if_fail(object != NULL);
g_return_if_fail(GTK_IS_TOOLBAR(object));
@ -152,7 +157,7 @@ gtk_toolbar_map(GtkWidget *widget)
{
GtkToolbar *toolbar;
GList *children;
GtkWidget *child;
Child *child;
g_return_if_fail(widget != NULL);
g_return_if_fail(GTK_IS_TOOLBAR(widget));
@ -173,7 +178,7 @@ gtk_toolbar_unmap(GtkWidget *widget)
{
GtkToolbar *toolbar;
GList *children;
GtkWidget *child;
Child *child;
g_return_if_fail(widget != NULL);
g_return_if_fail(GTK_IS_TOOLBAR(widget));
@ -195,7 +200,7 @@ gtk_toolbar_draw(GtkWidget *widget,
{
GtkToolbar *toolbar;
GList *children;
GtkWidget *child;
Child *child;
GdkRectangle child_area;
g_return_if_fail(widget != NULL);
@ -219,7 +224,7 @@ gtk_toolbar_size_request(GtkWidget *widget,
{
GtkToolbar *toolbar;
GList *children;
GtkWidget *child;
Child *child;
gint nchildren;
g_return_if_fail(widget != NULL);
@ -242,8 +247,8 @@ gtk_toolbar_size_request(GtkWidget *widget,
gtk_widget_size_request(child->button, &child->button->requisition);
toolbar->child_maxw = MAX(toolbar->child_maxw, child->button->requisition->width);
toolbar->child_maxh = MAX(toolbar->child_maxh, child->button->requisition->height);
toolbar->child_maxw = MAX(toolbar->child_maxw, child->button->requisition.width);
toolbar->child_maxh = MAX(toolbar->child_maxh, child->button->requisition.height);
} else
/* NULL child means it is a space in the toolbar, rather than a button */
if (toolbar->orientation == GTK_ORIENTATION_HORIZONTAL)
@ -267,7 +272,7 @@ gtk_toolbar_size_allocate(GtkWidget *widget,
{
GtkToolbar *toolbar;
GList *children;
GtkWidget *child;
Child *child;
GtkAllocation alloc;
g_return_if_fail(widget != NULL);
@ -335,7 +340,6 @@ gtk_toolbar_insert_item(GtkToolbar *toolbar,
{
Child *child;
GtkWidget *vbox;
GtkWidget *label;
g_return_if_fail(toolbar != NULL);
g_return_if_fail(GTK_IS_TOOLBAR(toolbar));
@ -349,17 +353,17 @@ gtk_toolbar_insert_item(GtkToolbar *toolbar,
else
child->label = NULL;
child->icon = icon;
child->icon = GTK_WIDGET(icon);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(button), vbox);
gtk_container_add(GTK_CONTAINER(child->button), vbox);
gtk_widget_show(vbox);
if (child->icon)
gtk_box_pack_start(GTK_BOX(vbox), child->icon);
gtk_box_pack_start(GTK_BOX(vbox), child->icon, FALSE, FALSE, 0);
if (child->label)
gtk_box_pack_start(GTK_BOX(vbox), child->label);
gtk_box_pack_start(GTK_BOX(vbox), child->label, FALSE, FALSE, 0);
switch (toolbar->style) {
case GTK_TOOLBAR_ICONS:
@ -390,20 +394,20 @@ gtk_toolbar_insert_item(GtkToolbar *toolbar,
toolbar->children = g_list_insert(toolbar->children, child, position);
toolbar->num_children++;
gtk_widget_set_parent(child->button, toolbar);
gtk_widget_set_parent(child->button, GTK_WIDGET(toolbar));
if (GTK_WIDGET_VISIBLE(toolbar)) {
if (GTK_WIDGET_REALIZED(toolbar)
&& !GTK_WIDGET_REALIZED(button))
gtk_widget_realize(button);
&& !GTK_WIDGET_REALIZED(child->button))
gtk_widget_realize(child->button);
if (GTK_WIDGET_MAPPED(toolbar)
&& !GTK_WIDGET_MAPPED(button))
gtk_widget_map(button);
&& !GTK_WIDGET_MAPPED(child->button))
gtk_widget_map(child->button);
}
if (GTK_WIDGET_VISIBLE(button) && GTK_WIDGET_VISIBLE(toolbar))
gtk_widget_queue_resize(button);
if (GTK_WIDGET_VISIBLE(child->button) && GTK_WIDGET_VISIBLE(toolbar))
gtk_widget_queue_resize(child->button);
}
void
@ -427,7 +431,7 @@ gtk_toolbar_insert_space(GtkToolbar *toolbar,
/* NULL child means it is a space in the toolbar, rather than a button */
toolbar->children = g_list_insert(toolbar->children, NULL);
toolbar->children = g_list_insert(toolbar->children, NULL, position);
if (GTK_WIDGET_VISIBLE(toolbar))
gtk_widget_queue_resize(GTK_WIDGET(toolbar));

View File

@ -24,6 +24,7 @@
#include <gdk/gdk.h>
#include <gtk/gtkcontainer.h>
#include <gtk/gtkenums.h>
#include <gtk/gtkpixmap.h>
#ifdef __cplusplus