1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00
putty-source/unix/gtkpanel.h
Simon Tatham df85003ea5 First stab at a GTK layout engine. It's missing all sorts of stuff
(list boxes are particularly conspicuously absent), it has no event
handling at all, and it isn't in any way integrated into pterm - you
have to build it specially using the test stubs in gtkdlg.c. But
what there is so far seems to work plausibly well, so it's a start.
Rather than browbeat the existing GTK container/layout widgets into
doing what I wanted, I decided to implement two subclasses of
GtkContainer myself, which implement precisely the layout model
assumed by the config box specification; this has the rather cool
consequence that the box can be resized and will maintain the same
layout at all times that it would have had if initially created at
that size.

[originally from svn r2931]
2003-03-13 19:52:28 +00:00

49 lines
1.3 KiB
C

/*
* gtkpanel.h - header file for a panel-based widget container,
* which holds a number of widgets of which at most one is ever
* visible at a time, and sizes itself to the maximum of its
* children's potential size requests.
*/
#ifndef PANELS_H
#define PANELS_H
#include <gdk/gdk.h>
#include <gtk/gtkcontainer.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define TYPE_PANELS (panels_get_type())
#define PANELS(obj) (GTK_CHECK_CAST((obj), TYPE_PANELS, Panels))
#define PANELS_CLASS(klass) \
(GTK_CHECK_CLASS_CAST((klass), TYPE_PANELS, PanelsClass))
#define IS_PANELS(obj) (GTK_CHECK_TYPE((obj), TYPE_PANELS))
#define IS_PANELS_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), TYPE_PANELS))
typedef struct Panels_tag Panels;
typedef struct PanelsClass_tag PanelsClass;
typedef struct PanelsChild_tag PanelsChild;
struct Panels_tag {
GtkContainer container;
/* private after here */
GList *children; /* this just holds GtkWidgets */
};
struct PanelsClass_tag {
GtkContainerClass parent_class;
};
GtkType panels_get_type(void);
GtkWidget *panels_new(void);
void panels_add(Panels *panels, GtkWidget *child);
void panels_switch_to(Panels *panels, GtkWidget *child);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* PANELS_H */