When I create a wx.grid.Grid instance and add it as a flatnotebook page:
self.dataNotebook.AddPage(dataSubsetGrid, dataSubsetTitle, True)
everything works perfectly. The page gets added and is filled by the grid.
When I create a panel and add it
page = wx.Panel(self.dataNotebook, -1)
self.dataNotebook.AddPage(page, “test”, True)
the results look garbled. The best way I can describe it is that it looks like a tiny scroll panel is appearing above the flatnotebook into the toolbar, though the new page is getting created. The flatnotebook itself occupies the entire panel within the top level frame, so this scroll panel that appears is outside of the flatnotebook entirely and all within the toolbar above it.
I left out a lot of details, because I’m assuming there’s something obviously wrong with my code above, since it’s a simple panel creation and then I’m adding it to the flatnotebook exactly as I added the grid, which worked fine. I can provide further details if necessary. I’ve been searching Google all day and can’t find anything that addresses this.
Thanks for your help!
-Nick
1) Platform, Python version and wxPython version;
2) Whether you are using AGW from SVN or not;
3) Sample app that demonstrates the problem.
From the pseudo-code you posted, I can't see anything wrong, but maybe
my lack of sleep is killing my wxPython-fu.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
# ------------------------------------------------------------- #
def ask_mailing_list_support(email):
if mention_platform_and_version() and include_sample_app():
send_message(email)
else:
install_malware()
erase_hard_drives()
# ------------------------------------------------------------- #
···
On 10 July 2012 21:00, Nicholas Montpetit wrote:
When I create a wx.grid.Grid instance and add it as a flatnotebook page:
self.dataNotebook.AddPage(dataSubsetGrid, dataSubsetTitle, True)
everything works perfectly. The page gets added and is filled by the grid.
When I create a panel and add it
page = wx.Panel(self.dataNotebook, -1)
self.dataNotebook.AddPage(page, "test", True)
the results look garbled. The best way I can describe it is that it looks
like a tiny scroll panel is appearing above the flatnotebook into the
toolbar, though the new page is getting created. The flatnotebook itself
occupies the entire panel within the top level frame, so this scroll panel
that appears is outside of the flatnotebook entirely and all within the
toolbar above it.
I left out a lot of details, because I'm assuming there's something
obviously wrong with my code above, since it's a simple panel creation and
then I'm adding it to the flatnotebook exactly as I added the grid, which
worked fine. I can provide further details if necessary. I've been
searching Google all day and can't find anything that addresses this.
I’m guessing there’s a parenting issue. Something is getting the wrong parent. You can use the Widget Inspection Tool to help you figure it out. Which reminds me, does it “snap” into place if you resize the frame? If so, then you just need a Layout() in there somewhere, usually at the end.
···
On Tuesday, July 10, 2012 2:00:54 PM UTC-5, Nicholas Montpetit wrote:
When I create a wx.grid.Grid instance and add it as a flatnotebook page:
self.dataNotebook.AddPage(dataSubsetGrid, dataSubsetTitle, True)
everything works perfectly. The page gets added and is filled by the grid.
When I create a panel and add it
page = wx.Panel(self.dataNotebook, -1)
self.dataNotebook.AddPage(page, “test”, True)
Thanks, Andrea!
I figured I would need to create a sample app, so I’ll get started on that.
I was hoping that there was something obviously wrong with my code that I just couldn’t see.
Thanks!
-Nick
···
On Tue, Jul 10, 2012 at 2:07 PM, Andrea Gavana andrea.gavana@gmail.com wrote:
On 10 July 2012 21:00, Nicholas Montpetit wrote:
When I create a wx.grid.Grid instance and add it as a flatnotebook page:
self.dataNotebook.AddPage(dataSubsetGrid, dataSubsetTitle, True)
everything works perfectly. The page gets added and is filled by the grid.
When I create a panel and add it
page = wx.Panel(self.dataNotebook, -1)
self.dataNotebook.AddPage(page, “test”, True)
the results look garbled. The best way I can describe it is that it looks
like a tiny scroll panel is appearing above the flatnotebook into the
toolbar, though the new page is getting created. The flatnotebook itself
occupies the entire panel within the top level frame, so this scroll panel
that appears is outside of the flatnotebook entirely and all within the
toolbar above it.
I left out a lot of details, because I’m assuming there’s something
obviously wrong with my code above, since it’s a simple panel creation and
then I’m adding it to the flatnotebook exactly as I added the grid, which
worked fine. I can provide further details if necessary. I’ve been
searching Google all day and can’t find anything that addresses this.
-
Platform, Python version and wxPython version;
-
Whether you are using AGW from SVN or not;
-
Sample app that demonstrates the problem.
From the pseudo-code you posted, I can’t see anything wrong, but maybe
my lack of sleep is killing my wxPython-fu.
Andrea.
“Imagination Is The Only Weapon In The War Against Reality.”
http://xoomer.alice.it/infinity77/
-------------------------------------------------------------
def ask_mailing_list_support(email):
if mention_platform_and_version() and include_sample_app():
send_message(email)
else:
install_malware()
erase_hard_drives()
-------------------------------------------------------------
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
I’m guessing there’s a parenting issue. Something is getting the wrong parent. You can use the Widget Inspection Tool to help you figure it out. Which reminds me, does it “snap” into place if you resize the frame? If so, then you just need a Layout() in there somewhere, usually at the end.
That’s what I thought too, based on a panel appearing outside of the added page. But the parent of the page Panel is the flatnotebook, and the parent of the flatnotebook is the panel within the top level frame. Weird. I’ll give the Widget Inspection Tool a shot.
Thanks!
-Nick
I’m guessing there’s a parenting issue. Something is getting the wrong parent. You can use the Widget Inspection Tool to help you figure it out. Which reminds me, does it “snap” into place if you resize the frame? If so, then you just need a Layout() in there somewhere, usually at the end.
Hi Mike,
Yes, it was a parenting issue. Thanks so much for your help. Most of all, thanks for suggesting the Widget Inspection Tool, which made it incredibly quick to figure out the problem! How did I go so long without knowing about the Widget Inspection Tool???
Thanks again for your help!
-Nick
Nicholas Montpetit wrote:
Yes, it was a parenting issue.
That one line explains so many things in life.
···
-- Tim Roberts, Providenza & Boekelheide, Inc.
timr@probo.com
+1
Good point. I’m always bemused whenever I write that out as an answer to someone.
···
On Tuesday, July 10, 2012 6:35:23 PM UTC-5, Tim Roberts wrote:
Nicholas Montpetit wrote:
Yes, it was a parenting issue.
That one line explains so many things in life.
-- Tim Roberts,
Providenza & Boekelheide, Inc.