More GTK+ area work.
This commit is contained in:
parent
30b6a0a696
commit
00e005b71a
|
@ -37,6 +37,7 @@ static void updateScroll(areaWidget *a)
|
||||||
ap->clientWidth / pixelsPer,
|
ap->clientWidth / pixelsPer,
|
||||||
ap->clientWidth / pixelsPer);
|
ap->clientWidth / pixelsPer);
|
||||||
|
|
||||||
|
// TODO sometimes changing htis results inn no change until the window is significantly resized
|
||||||
(*(ap->ah->VScrollConfig))(ap->ah, ap->a,
|
(*(ap->ah->VScrollConfig))(ap->ah, ap->a,
|
||||||
&count, &pixelsPer);
|
&count, &pixelsPer);
|
||||||
gtk_adjustment_configure(ap->va,
|
gtk_adjustment_configure(ap->va,
|
||||||
|
@ -235,3 +236,8 @@ GtkWidget *newArea(uiAreaHandler *ah)
|
||||||
"area-handler", ah,
|
"area-handler", ah,
|
||||||
NULL));
|
NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void areaUpdateScroll(GtkWidget *area)
|
||||||
|
{
|
||||||
|
updateScroll(areaWidget(area));
|
||||||
|
}
|
||||||
|
|
|
@ -30,3 +30,4 @@ extern GType areaWidget_get_type(void);
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
extern GtkWidget *newArea(uiAreaHandler *ah);
|
extern GtkWidget *newArea(uiAreaHandler *ah);
|
||||||
|
extern void areaUpdateScroll(GtkWidget *area);
|
||||||
|
|
|
@ -7,6 +7,7 @@ struct handler {
|
||||||
uiAreaHandler ah;
|
uiAreaHandler ah;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static GtkWidget *area;
|
||||||
static struct handler h;
|
static struct handler h;
|
||||||
static GtkWidget *nhspinb;
|
static GtkWidget *nhspinb;
|
||||||
static GtkWidget *pphspinb;
|
static GtkWidget *pphspinb;
|
||||||
|
@ -27,7 +28,7 @@ static void handlerVScrollConfig(uiAreaHandler *a, uiArea *area, uintmax_t *n, u
|
||||||
|
|
||||||
static void recalcScroll(GtkSpinButton *sb, gpointer data)
|
static void recalcScroll(GtkSpinButton *sb, gpointer data)
|
||||||
{
|
{
|
||||||
// TODO
|
areaUpdateScroll(area);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkWidget *makeSpinbox(int min)
|
static GtkWidget *makeSpinbox(int min)
|
||||||
|
@ -45,7 +46,6 @@ int main(void)
|
||||||
GtkWidget *mainwin;
|
GtkWidget *mainwin;
|
||||||
GtkWidget *box;
|
GtkWidget *box;
|
||||||
GtkWidget *scroller;
|
GtkWidget *scroller;
|
||||||
GtkWidget *area;
|
|
||||||
GtkWidget *grid;
|
GtkWidget *grid;
|
||||||
|
|
||||||
h.ah.HScrollConfig = handlerHScrollConfig;
|
h.ah.HScrollConfig = handlerHScrollConfig;
|
||||||
|
|
Loading…
Reference in New Issue