473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 3350
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 could not find any documentation in the help...
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 that the user can get additionally information...
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 TAB section with ( for example ) red color. I've...
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 Form Control and put it on my ASP .NET page. I...
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. The GUI should have other panels with buttons etc....
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: *************** <embed src="Test.asx" width=320 height=300...
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 FileDialog and tkFileDialog methods but they open as pop...
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 elements in addition to some information associated with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.