/* Standard headers */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
/* Local headers */
#include "ablibs.h"
#include "abimport.h"
#include "proto.h"
#include <Ph.h>
int
MoveLabel( PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo )
{
PhPoint_t lbl_pos;
unsigned short *wnd_width;
unsigned short *wnd_height;
PtWidget_t *parent_wnd;
/* eliminate 'unreferenced' warnings */
widget = widget, apinfo = apinfo, cbinfo = cbinfo;
/* Specifying a position outside the window's area does not generate an error.
But the widget will not be visible. */
parent_wnd = PtGetParent(widget, PtWindow);
PtGetResource( parent_wnd, Pt_ARG_WIDTH, &wnd_width, 0);
PtGetResource( parent_wnd, Pt_ARG_HEIGHT, &wnd_height, 0);
lbl_pos.x = (int) *wnd_width / 2;
lbl_pos.y = (int) *wnd_height / 2;
PtSetResource( ABW_lbl1, Pt_ARG_POS, &lbl_pos, 0);
return( Pt_CONTINUE );
}
Explanation:
Home | About Me | Copyright © Neil Carter |
Content last updated: 2003-09-23