int32_t PListViewScrollToPoint(void *pobject, void *in, void *out, void *extraData) { if (!pobject || !in || !out) return B_ERROR; PView *parent = static_cast<PView*>(pobject); if (!parent) return B_BAD_TYPE; BListView *backend = (BListView*)parent->GetView(); PArgs *inArgs = static_cast<PArgs*>(in); BPoint pt; if (inArgs->FindPoint("pt", &pt) != B_OK) return B_ERROR; if (backend->Window()) backend->Window()->Lock(); backend->ScrollTo(pt); if (backend->Window()) backend->Window()->Unlock(); return B_OK; }
int32_t PListViewScrollTo(void *pobject, void *in, void *out, void *extraData) { if (!pobject || !in || !out) return B_ERROR; PView *parent = static_cast<PView*>(pobject); if (!parent) return B_BAD_TYPE; BListView *backend = (BListView*)parent->GetView(); PArgs *inArgs = static_cast<PArgs*>(in); float x; if (inArgs->FindFloat("x", &x) != B_OK) return B_ERROR; float y; if (inArgs->FindFloat("y", &y) != B_OK) return B_ERROR; if (backend->Window()) backend->Window()->Lock(); backend->ScrollTo(x, y); if (backend->Window()) backend->Window()->Unlock(); return B_OK; }