472,333 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,333 software developers and data experts.

Embedding a close button in a WxNoteBook

Hi there,

Gotta problem n embedding a close button in the notebook

Lemme know if there are any specific method of doing it!!

To be specific, i need it look like the close tab in mozille r fire fox browsers
Sep 1 '06 #1
1 3289
bartonc
6,596 Expert 4TB
Try this:

#!/usr/bin/env python
# -*- coding: ISO-8859-1 -*-
# generated by wxGlade 0.4 on Tue Sep 12 14:43:34 2006

import wx

class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.notebook_1 = wx.Notebook(self, -1, style=0)
self.notebook_1_pane_1 = wx.Panel(self.notebook_1, -1)
self.button_1 = wx.Button(self.notebook_1_pane_1, -1, "button_1")

self.__set_properties()
self.__do_layout()

self.Bind(wx.EVT_BUTTON, self.OnCloseButton, self.button_1)
# end wxGlade

def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("frame_1")
# end wxGlade

def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_1 = wx.BoxSizer(wx.VERTICAL)
sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
sizer_2.Add(self.button_1, 0, wx.ADJUST_MINSIZE, 0)
self.notebook_1_pane_1.SetAutoLayout(True)
self.notebook_1_pane_1.SetSizer(sizer_2)
sizer_2.Fit(self.notebook_1_pane_1)
sizer_2.SetSizeHints(self.notebook_1_pane_1)
self.notebook_1.AddPage(self.notebook_1_pane_1, "tab1")
sizer_1.Add(self.notebook_1, 1, wx.EXPAND, 0)
self.SetAutoLayout(True)
self.SetSizer(sizer_1)
sizer_1.Fit(self)
sizer_1.SetSizeHints(self)
self.Layout()
# end wxGlade

def OnCloseButton(self, event): # wxGlade: MyFrame.<event_handler>
print "Event handler `OnCloseButton' not implemented!"
event.Skip()

# end of class MyFrame


class MyApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
frame_1 = MyFrame(None, -1, "")
self.SetTopWindow(frame_1)
frame_1.Show()
return 1

# end of class MyApp

if __name__ == "__main__":
app = MyApp(0)
app.MainLoop()
Sep 12 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Gandalf | last post by:
How can I hide/show a page (wxNotebookPage) invisible of a wx.wxNotebook instance? There is a GetPage() method which returns a wxNotebookPage but I...
0
by: klaus.roedel | last post by:
Hi, I've implemented a wxnotebook on my application. I can set a tooltip for the complete notebook, but I want to set for every page a tooltip, so...
3
by: mardif | last post by:
Hi ! this is my problem: I've a wxNotebook object, which contains 2 Panels. On up, there is TAB section, I have 2 tabs. I want to color the...
0
by: Budhi Saputra Prasetya | last post by:
Hi, I still have the same problem with embedding Windows Control. I'll just requote what I posted last time: I managed to create a Windows...
0
by: Soren | last post by:
Hi, I've been trying to embed matplotlib in wxpython. I want to be able to put a figure (axes) in a wx.Panel and place it somewhere in my GUI....
5
by: Anil Gupte | last post by:
How do I embed Windows Media Player so I can control it with VB code. I am familiar with embedding in a web page like this: ***************...
2
by: devnew | last post by:
i am trying out tkinter to make a gui..i want to have a frame with an embedded file explorer next to a 'open directory' label..i tried out...
4
by: Ken Fine | last post by:
I'm making an administrative interface that lists records in a GridView. For *each* row in the gridview, I would there to be two interface...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.