List Info

Thread: notebook question




notebook question
user name
2006-05-22 21:40:49
hello, is there a way to hide just one page of a notebook. I have a notebook with four pages and I want to hide a page sometimes. thanks.

Jeff


Feel free to call! Free PC-to-PC calls. Low rates on PC-to-Phone. Get Yahoo! Messenger with Voice
notebook question
user name
2006-05-22 22:24:25
Jeff Peery wrote:
> hello, is there a way to hide just one page of a
notebook. I have a 
> notebook with four pages and I want to hide a page
sometimes. thanks.

No, the notebook doesn't support that, you need to remove
the page 
(which removes the tab) and then ensure that the page window
is hidden 
if you don't want to destroy it yet.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java
give you jitters?  Relax with wxPython!


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org

notebook question
user name
2006-05-22 22:23:01
Jeff Peery <jeffpeeryyahoo.com> wrote:
> hello, is there a way to hide just one page of a
notebook. I have a
> notebook with four pages and I want to hide a page
sometimes. thanks.

saved = nb.GetPage(i)
nb.RemovePage(i)

...

nb.InsertPage(i, saved)



 - Josiah


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org

notebook question
user name
2006-05-26 18:24:02
ok thanks, one more question. when I remove a page, does that imply that all the controls on that page are also removed? or do I need to handle all the controls/panels/windows etc that reside on the removed page? thanks.
 
Jeff

Robin Dunn <robinalldunn.com> wrote:
Jeff Peery wrote:
>; hello, is there a way to hide just one page of a notebook. I have a
> notebook with four pages and I want to hide a page sometimes. thanks.

No, the notebook doesn't support that, you need to remove the page
(which removes the tab) and then ensure that the page window is hidden
if you don't want to destroy it yet.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!


---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org



Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2¢/min with Yahoo! Messenger with Voice.
notebook question
user name
2006-05-27 00:18:40
Jeff Peery wrote:
> ok thanks, one more question. when I remove a page,
does that imply that 
> all the controls on that page are also removed? 

They are still on the page window, so they are not actually
removed from 
anywhere.  But if the page window is not visible, or if it
gets 
destroyed, then its children are too.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java
give you jitters?  Relax with wxPython!


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org

date time problems
user name
2006-05-30 01:49:51
hello, I was wondering if anyone could help me out with this quick question. I'm writting a wxpython application and I am using matplotlib. I'm using matplotlib.dates.date2num and there is a strange thing I don't understand. for the date2num function you input the number of days since 01-01-01 and the function outputs the date. pretty simple but assuming 365 days per year if I want to go 1000 years later I don't end up with 1000-01-01. see example below for the case of 2 years and 5 years. the 2 year case is expected but the 5 yr case is not. does anyone know why this is happening...? I need to add an exta day for some reason. is this because the number of days per year is not exactly 365 but 365.2....? how do I get from a to b without knowing the exact number of days per year? thanks.

>>&gt; print num2date(365*2 + 1)
0003-01-01 00:00:00+00:00

>>&gt; print num2date(365*5 + 1)
0005-12-31 00:00:00+00:00


Sneak preview the all-new Yahoo.com. It's not radically different. Just radically better.
date time problems
user name
2006-05-30 02:31:39
On Mon, May 29, 2006 at 06:49:51PM -0700, Jeff Peery wrote:

> hello, I was wondering if anyone could help me out with
this quick
> question. I'm writting a wxpython application and I am
using
> matplotlib. I'm using matplotlib.dates.date2num and
there is a strange
>   >>> print num2date(365*2 + 1)
>   0003-01-01 00:00:00+00:00
>     >>> print num2date(365*5 + 1)
>     0005-12-31 00:00:00+00:00

Ah, the fun of date/time arithmetic. If you want some real
fun, start
looking into the quirks of our Gregorian calendar. After
that, learn
about Julian, Hebrew, Chinese, and Mayan. It's probably one
of the
single hardest things to get right in a program. Which is
why I always
try to leave the date/time stuff to the experts who've
already written
the code.

I'm not familiar enough with the wx.DateTime module, but
I'm sure
somebody here is. I just spent 30 seconds, and realized that
I can't
answer your question to fix the code to do what you expect.
However, I
*can* answer some questions about the calendar:

Every 4 years, we have a leap year. Unless that year is
divsible by 100,
unless THAT year is evenly divisible by 400.
So, for example, 1996 was a leap year. 2004 was a leap year.
2000 was
a leap year (as 2000 is evenly divisible by 400). 1900 was
not. Nor will
2100, 2200, and 2300.

Another issue is that that of the calendar switchover (for
you, and your
dates, this looks like it might matter). You see, in (I
think) 1518, the
Pope commissioned a fix of the calendar. Since leap years
hadn't been
properly accounted for before, the calendar had grown out of
sync with
the sun. In other words, spring was coming earlier and
earlier. Since
Easter is tied with spring, we couldn't affect the holy
holiday in such
a fashion. So, the calendar got fixed.

As a result of this, there is a period of several days
(approximately
10, I think) which simply do not exist. If memory serves, in
October,
1518, the date was adjusted forward by 10 days. So, for
example, people
went to sleep on October 16, 1518, and woke up on October
26, 1518.

Never mind the confusing issues of converting to other
calendars and
systems of timekeeping. It's a royal mess.

Anyway, I've rambled enough about it. The glorious upshot
of all this is
this bit of advice: Find a date/time library that does what
you need it
to, and does it accurately. Then stick with it, and don't
change away
from it without very good reason. Me, I'm switching into
wxPython, and
don't know the "pythonic" way to handle this,
so that's my excuse for
not coding the solution for you 

For more info, read this article: http://en.wiki
pedia.org/wiki/Leap_Year
-- 
Michael J. Pedersen
My IM IDs: Jabber/pedersenicelus.tzo.com,
ICQ/103345809, AIM/pedermj022171
           Yahoo/pedermj2002, MSN/pedermj022171hotmail.com
My GnuPG KeyID: 4E724A60             My Public Key Available
At: pgp.mit.edu
My GnuPG Key Fingerprint: C31C 7E90 5992 9E5E 9A02  233D
D8DD 985E 4E72 4A60
date time problems
user name
2006-05-30 03:01:05
Jeff Peery <jeffpeeryyahoo.com> wrote:
> hello, I was wondering if anyone could help me out with
this quick  question. I'm writting a wxpython application
and I am using  matplotlib. I'm using
matplotlib.dates.date2num and there is a strange  thing I
don't understand. for the date2num function you input the 
number of days since 01-01-01 and the function outputs the
date. pretty  simple but assuming 365 days per year if I
want to go 1000 years later  I don't end up with
1000-01-01. see example below for the case of 2  years and 5
years. the 2 year case is expected but the 5 yr case is 
not. does anyone know why this is happening...? I need to
add an exta  day for some reason. is this because the number
of days per year is not  exactly 365 but 365.2....? how do I
get from a to b without knowing the  exact number of days
per year? thanks.
>   
>   >>> print num2date(365*2 + 1)
>   0003-01-01 00:00:00+00:00
>   
>     >>> print num2date(365*5 + 1)
>     0005-12-31 00:00:00+00:00


Use the datetime Python module.

>>> import datetime
>>> a = datetime.date(2006, 5, 29)
>>> years = 5
>>> x = 365*years
>>> b = a + datetime.timedelta(days=x)
>>> while b.year-years < a.year or b.month <
a.month or b.day < a.day:
...     x += 1
...     b = a + datetime.timedelta(days=x)
...
>>> b
datetime.date(2011, 5, 29)


 - Josiah


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org

date time problems
user name
2006-05-30 03:03:19
On 30/05/06, Josiah Carlson <jcarlsonuci.edu> wrote:
> Use the datetime Python module.
>
> >>> import datetime
> >>> a = datetime.date(2006, 5, 29)
> >>> years = 5
> >>> x = 365*years
> >>> b = a + datetime.timedelta(days=x)
> >>> while b.year-years < a.year or b.month
< a.month or b.day < a.day:
> ...     x += 1
> ...     b = a + datetime.timedelta(days=x)
> ...
> >>> b
> datetime.date(2011, 5, 29)

Or, if you're really concerned with increasing years whilst
keeping
the rest the same, you could just do: b =
datetime.date(a.year+5,
a.month, a.day)   

-- 
John.

------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org

date time problems
user name
2006-05-30 03:07:25
On Tuesday 30 May 2006 12:31, Michael J. Pedersen wrote:
> So, for example, people
> went to sleep on October 16, 1518, and woke up on
October 26, 1518.

Duh, happens to me all the time 

Horst

------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org

[1-10] [11-12]

about | contact  Other archives ( Real Estate discussion Medical topics )