Skip navigation.
Home
The QNX Community Portal

View topic - PtCalendar usage

PtCalendar usage

Read-only archive of qnx.gui (Creating graphical applications within a GUI environment, such as Photon or PhAB) at inn.qnx.com

PtCalendar usage

Postby M.Shanthi » Mon Oct 04, 2004 10:32 am

Hi,

In one of my applications, I 'm trying to change the system date,month &
year using the PtCalendar widget. After any change, the changed date ,
month and year should be set in a text box.For this, I'm writing code in
Pt_CB_CALENDAR_SELECT callback.But, I'm not successful.Can anyone send me
a snippet/ suggest some ideas as how to proceed?

Bye.
M.Shanthi
 

Re: PtCalendar usage

Postby bilcar » Mon Oct 04, 2004 4:46 pm

M.Shanthi <shanthi@bhelrpt.co.in> wrote:
MS > Hi,

MS > In one of my applications, I 'm trying to change the system date,month &
MS > year using the PtCalendar widget. After any change, the changed date ,
MS > month and year should be set in a text box.For this, I'm writing code in
MS > Pt_CB_CALENDAR_SELECT callback.But, I'm not successful.Can anyone send me
MS > a snippet/ suggest some ideas as how to proceed?

MS > Bye.

I don't think the PtCalendar widget ever attempts to change the actual
system date/time. In your callback you'll need to also call
settimeofday().

Hope that helps.
bilcar
Senior Member
 
Posts: 573
Joined: Wed Feb 04, 2004 5:50 pm
Location: Crete, IL

Re: PtCalendar usage

Postby M.Shanthi » Tue Oct 05, 2004 7:44 am

Dear Bill Caroselli,

Thanks for the reply.
I shall try with settimeofday();

Regards,
M.Shanthi
M.Shanthi
 

RE: Re: PtCalendar usage

Postby Alito » Mon Jan 28, 2008 2:17 pm

Hi, I have another problem whit the PtCalendar:
This is the situation: My PtCalendar have a Pt_CB_CALENDAR_SELECT callback, the code in the callback should give me the date of the calendar where I do click but it always return the same value (a constant) of day, month and year; this is the code:

int FindDay(PtWidget *widget, ApInfo *apinfo, PtCallbackInfo *cbinfo)
{
PtCalendarDate_t date;
widget=widget, apinfo=apinfo, cbinfo=cbinfo;

PtGetResource(widget, Pt_ARG_CALENDAR_DATE, &date, sizeof(date));
printf("year: %d - month: %d - day: %d", date.year, date.month+1, date.day+1);
flushall();

return(Pt_CONTINUE);
}

Please help me, thanks.
Alito
New Member
 
Posts: 2
Joined: Fri Apr 27, 2007 10:39 pm

Re: Re: PtCalendar usage

Postby Misha Nefedov » Mon Jan 28, 2008 4:30 pm

The date should be *date.

"Alito" <alenu_24@hotmail-dot-com.no-spam.invalid> wrote in message
news:fnktut$f7q$1@inn.qnx.com...
Hi, I have another problem whit the PtCalendar:
This is the situation: My PtCalendar have a Pt_CB_CALENDAR_SELECT
callback, the code in the callback should give me the date of the
calendar where I do click but it always return the same value (a
constant) of day, month and year; this is the code:

int FindDay(PtWidget *widget, ApInfo *apinfo, PtCallbackInfo *cbinfo)
{
PtCalendarDate_t date;
widget=widget, apinfo=apinfo, cbinfo=cbinfo;

PtGetResource(widget, Pt_ARG_CALENDAR_DATE, &date,
sizeof(date));
printf("year: %d - month: %d - day: %d", date.year,
date.month+1, date.day+1);
flushall();

return(Pt_CONTINUE);
}

Please help me, thanks.
Misha Nefedov
 

RE: Re: Re: PtCalendar usage

Postby Alito » Thu Jan 31, 2008 5:00 pm

Thank you for reply, I do it work using the PtCallbackInfo *cbinfo parameter, I do this:

int FindDay(PtWidget *widget, ApInfo *apinfo, PtCallbackInfo *cbinfo)
{
PtCalendarSelectCallback_t *calendar;
calendar = cbinfo->cbdata;

printf("year: %d - month: %d - day: %d", calendar->date.year, calendar->date.month+1, calendar->date.day+1);
flushall();

return(Pt_CONTINUE);
}

Again thank you for your time.
Alito
New Member
 
Posts: 2
Joined: Fri Apr 27, 2007 10:39 pm


Return to qnx.gui

Who is online

Users browsing this forum: No registered users and 2 guests

cron