FAQ Database Discussion Community


wxPython New, Save, and SaveAs Methods

python,wxpython
I'm writing a UI for a python app with wxPython. I've handled a few of the OnX functions but I need help with OnNew and OnSave/SaveAs Here is my Save and SaveAs code: def OnSave(self, event): self.dirname = "" saveFileDialog = wx.FileDialog(self, "Save Operation File", self.dirname, "", "Operation Files (*.fwr)|*.fwr|All...

Derived panel classes in wxpython

python,wxpython
In my wxpython program, my panel is behaving differently depending on whether I make it a derived class or a straight panel instance: import wx class PanelWithText(wx.Panel): def __init__(self, parent): super(PanelWithText, self).__init__(parent) hbox1 = wx.BoxSizer(wx.HORIZONTAL) panel1 = wx.Panel(parent) st1 = wx.StaticText(panel1, label='Some Text') hbox1.Add(st1) class Example(wx.Frame): def __init__(self, parent, title):...

Get Selected Button from RadioButton Group with Wxpython

python,python-2.7,radio-button,wxpython
I have two wxpython radio button groups: self.red = wx.RadioButton(panel, -1, 'Red', (10, q2y), style=wx.RB_GROUP) self.orange = wx.RadioButton(panel, -1, 'Orange', (50, q2y)) self.yellow = wx.RadioButton(panel, -1, 'Yellow', (100, q2y)) self.dot = wx.RadioButton(panel, -1, 'Dot', (10, q3y), style=wx.RB_GROUP) self.triangle = wx.RadioButton(panel, -1, 'Triangle', (50, q3y)) self.rectange = wx.RadioButton(panel, -1, 'Rectangle', (100,...

wxPython add seperation mark to sizer

python,wxpython
I have two groups of Check Boxes in wx.BoxSizer(wx.HORIZONTAL). I would like to add something to distinguish that it's two different groups (something else than blank space). I'm looking for something similar to AppendSeparator() of wx.Menu() I've looked in Sizer Class but I don't see anything useful there. I'm trying...

How do I make matplotlib zoom and pan tool work with line markers

python,numpy,matplotlib,wxpython
I've developed a program that plots input from a spectrometer. The devices I'm attempting to communicate with are rated to send no more than 3 pixels of bad information (this part is unavoidable). What I'm trying to do is enable a picker to pick the 3 possible bad bits of...

Filtering ObjectListView - Python

python,filter,wxpython,objectlistview,sniffer
I'm using ObjectListView and I want to know if I can filter it by it's attributes. I'm using scapy to build a sniffer so I show all the packets in an ObjectListView, each row is a PacketObject that has an attribute called packet. Let's say I want to Filter by...

wxpython How to change the values of widgets in other panel

widget,wxpython,panel
My frame was split in three panels, In PanelTwo, There is a TextCtrl, In PanelThree , There is a TextCtrl too, When I input something in the TextCtrl of PanelTwo, I need change the value of the TextCtrl in PanelThree, How to do it? # -*- coding: utf-8 -*- import...

python: start a Multiprocessing process on wxbutton click

python,python-2.7,wxpython,multiprocessing,wx
I have a wxpython app running, and I was wondering if I could start another instance of the app as a result of a button click when the previous ones continue to run? something like : Start a wxpython app -> click on a button -> and the event spawns...

wxPython: access sizer of GUI generated by wxFormBuilder and replace child

user-interface,wxpython,wxformbuilder,objectlistview-python
I want to buid my applications under the idea of an MVC, with sepparate GUI and controller. In addition, I have a workmate much better than me in graphical tasks, and we want to distribute the work: he build the graphical part with wxFormBuilder and I build the "machinery" of...

wxpython: How to add am image in text control

python,wxpython
Am trying to display image in text control but it display only binary characters. But is their any way I can archive this or its impossible dream to do it in wxpython Please help I will need this agently. Thank you advance Here are the source codes that I have...

wxpython — a frame or panel similar to labelframe in ttk?

user-interface,wxpython,ttk
I used ttk's labelframes for many different things and have recently switched over to wxpython. I can't, for the life of me, find a similar panel or frame in wxpython. Does anyone know of any? I'd prefer it be native but if it isn't there, it isn't there. Thanks.

How to center panel with controlled aspect ratio

python,wxpython,wxwidgets,aspect-ratio
In wxPython, I'm having trouble centering a sub-panel that I've created to have a fixed aspect ratio. To control the aspect ratio, the sub-panel needs to capture the Size event and then do an explicit SetSize. So, I've done that and it works well. Unfortunately, when I embed this sub-panel...

Python import error inspite of having wxPython installed

python,wxpython,ubuntu-14.04
I have installed wxPython by following the instructions from this answer using the following command in Ubuntu 14.04 sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-doc wx2.8-examples wx2.8-headers wx2.8-i18n Everything got installed properly. But when I do import wx in my code, I get the following error. Python 2.7.6 (default, Mar 22...

wxPython - RichTextCtrl Event Handling

python,wxpython,richtextctrl
For testing purposes, I'm trying to print in the console everything that I write in a RichTextCtrl. However, it isn't working. Here is the way I wrote the binding for the RichTextCtrl, called textArea: self.textArea.Bind( wx.EVT_KEY_DOWN, self.syntaxColoring_C ) And here is the event handler: def syntaxColoring_C( self, event ): print...

wxPython Treebook Images [closed]

python,wxpython
In this official treebook tutorial they use the images module. I can't find it. Can someone give me a link or example how how to actually add things to the listbook? I want to eventually display the filesystem folders there. I can't find any information or examples, so a small...

Scapy - Raw layer to string and into a wx.TextCtrl

unicode,wxpython,python-2.6,scapy
I'm using scapy to show all layers of a packet and when the packet has a UDP layer and Raw it sometimes gives me an 'UnicodeDecodeError: 'charmap' codec can't decode byte...' and I dont know what to do .. help? this is the line of code that makes trouble :...

wxPython Swap Images

image,wxpython
I have been trying to swap 2 pictures in a list. I am adding the list to a GridSizer of 1 row and 2 cols. I have one horizontal BoxSizer where I am adding the GridSizer along with a button upon which, when clicked, the pictures are supposed to be...

TreeItemId obtained from TreeEvent is not the same as obtained from AppendItem

python,wxpython
I am building a program that will store some complex objects, and I am using wxPython for the UI. The objects hierarchy will have a tree representation (TreeCtrl). I am using a dictionary to map objects from the UI to the database, using the TreeItemIds returned by AppendItem as keys...

How to capture sub frame close event in main frame?

python,wxpython,wx
In WxPython, I have a new frame (ChildFrame) opening on a menu click on parent frame (ParentFrame). The child frame is for adding data to a config file. After the data is added (ie on close or on a button click in ChildFrame), I need to let the parent frame...

wxpython boxsizer addmany spacer

python,wxpython,boxsizer
How can I add a spacer between two items in a boxsizer, while using Add Many? I tried key words like Spacer, AddSpacer and things like that but unfortunately, it didn't work.

Easiest way ever to create bitmap in wxPython

wxpython
Sometimes it is required to create a dummy bitmap for test purposes. To make the bitmap discernable (e. g. a red one and green one), I am searching for a way to create a wx.Bitmap with as few lines of code as possible. What I did come up with sofar:...

Wx python componnets messed up in screen

python,wxpython
i've set a simple screen in wx.. all I have is 2 buttons few labels and grid. for some reason when the app is first lunched the components are not where it should be. they are all messed up. when i resize the window (for example the big square on...

Use StatusBar for Mouse Hover on Button

python,wxpython,statusbar
In my code, I've created StatusBar self.CreateStatusBar(). I can use this statusbar in MenuItem. Like Below: How can I use this statusbar in Button. Like, when I will enter my mouse over button, I will use this statusBar to give information about that button....

using threads with wxPython correctly

python,multithreading,wxpython
I'm using wxPython to build the GUI of my program,I am having trouble with running a function that uses a thread to get data from a file and display it in the ObjectListView, reading the data from the file runs fine but displaying the data from the thread sometimes crashes...

wxPython conditionally display and hide

jquery,python,wxpython
I am new to wxPython and would like to use it to build a simple dynamic UI which conditionally show and hide some drop-down boxes, which can be done easily in jQuery. So from my first level combo-box, if a user choose 'Op1_1', a second level combo-box A will appear....

TypeError: in method 'new_Frame', expected argument 2 of type 'int'

python,user-interface,window,wxpython,frame
import wx class MainWindow(wx.Frame): def _init_ (self, parent, title): wx.Frame. __init__(self, parent, title=title, size=(200, 100)) self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE) self.CreateStatusBar() #setting up the menu filemenu = wx.Menu() menuAbout = filemenu.Append(wx.ID_ABOUT, "About", "information about the use of this program") menuExit = filemenu.Append(wx.ID_EXIT, "Exit", "Exit this program") menuBar = wx.MenuBar() menuBar.Append(filemenu,"File") self.SetMenuBar(menuBar)...

Drawing a Continuous Line with a Mouse with wxPython

python,python-2.7,radio-button,wxpython
I am trying to make a "whiteboard" application in wxPython. I am trying to figure out how to draw a line that follows the mouse when the user is clicking down. def __init__(self, parent): wx.Frame.__init__(self, parent, title="White Board") self.Bind(wx.EVT_LIST_BEGIN_DRAG, self.OnDrag) def OnDrag(self, e): print "drag" The first step is trying...

How to scroll Panel with GridBagSizer in wxPython

python,wxpython,scrollable,gridbagsizer
I need to make a Panel scrollable. I've used GridBagSizer Code: import wx class MyFrame( wx.Frame ): def __init__( self, parent, ID, title ): wx.Frame.__init__( self, parent, ID, title, wx.DefaultPosition, wx.Size( 400, 300 ) ) self.InitUI() self.Center() self.Show() def InitUI(self): MPanel = wx.Panel(self) GridBag = wx.GridBagSizer(2, 2) CO = ["RED",...

wxPython Phoenix DataViewTreeControl() has “Segmentation fault (core dumped)”

python,wxpython
I am new to wxPython and am trying to add a DataViewTreeControl. The control shows up just fine. However, when I associate data I get Segmentation fault (core dumped). I have done enough work to know that it happens every time when it is trying to return from the GetValue()...

wxPython Acting on Element with Focus

python,wxpython
In my program I have a notebook with a vertical box sizer with buttons next to it. The buttons performed actions on the list box I had on the frame. But I moved the list boxes into the tabs of the notebook. How can I act on the elements of...

Matplotlib and WxPython - Interactive Toolbar Plot not doing a Refresh/Update on click

python,matplotlib,wxpython,toolbar,wx
I am trying to integrate matplotlib within a wxpython GUI, and I have gotten the interactive navigation toolbar to show up successfully. However, pressing any of the buttons does not change the plot, the plot only changes (based on the last pressed button) if you re-size the window or if...

The value of databases in wxpython

python,database,sqlite,wxpython
I have a wxpython script that opens 10's, or 100's or 1000's or more items from a users system. I store this information in memory and use what is needed by my script. Later if the user decides to save I store the needed information in a flat file that...

wxpython: small square panel in corner

python,wxpython,wx
Iam trying to place a small square panel(panel2) at the bottom rignt corner of another panel(panel1). The panel1 should fill the entire frame and expand as the frame is resized, but the squarepanel (panel2) should remain without expanding or resizing. something like this: I think Iam missing a small thing...

Which EvtHandler to use for PostEvent in wxPython

python,python-2.7,wxpython,python-multithreading
This question addresses the very specific question of the EvtHandler required to post en event using wxPython. Background I'm using Python 2.7. In the example below I have two kinds of events: StartMeausuringEvent is triggered within a wx.Panel derived object (DisplayPanel), hence I use self.GetEventHandler(), this works, even though the...

WxPython ListCtrl: One Column with Images and One with a String

python,wxpython
I am having this issue and have tried almost everything. I want one column with images and one with strings. I can get the strings, but not the images. Here is what I have: self.browserList=wx.ListCtrl(panel, pos=(20,150), size=(250,100), style.wx.LC_REPORT|wx.BORDER_SUNKEN) self.browserList.InsertColumn(0, '', width=50) self.browserList.InsertColumn(1, 'Browser: ', width=200) self.list=wx.ImageList(40,40) self.browserList.SetImageList(self.list, wx.IMAGE_LIST_NORMAL)...

wxPython. How to open a folder with wxWidget (python) hyperlink? [closed]

python,hyperlink,wxpython,folder,wxwidgets
I want to create a hyperlink in my wx widget which opens linked folder on clicking. Please help me how to build that. Thanks....

How to use wx.python demos code

python,wxpython,demo
I am a newbie in wx.python and python and wanted to use the MultiSplitterWindow.py demo code in my own application. I have read other stackoverflow entries regarding this subject but the answers given there don't seem to work for me. I would really appreciate if anybody could help me to...

wxPython search word in TextCrl

python,wxpython
I have a simple mini notepad program written in wxPython. the text is written in TextCtrl: self.rtb = wx.TextCtrl(self, ID_RTB, size=wx.Size(400,200), style=wx.TE_MULTILINE | wx.TE_RICH2) I wanted to implement a search feature where user gives a word and I'm highlighting it in the TextCtrl. my method is: def SearchIt(self,e): for line...

python deepcopy of wx object

python,wxpython
I have a wx.TreeCtrl and want to make a real copy of it. I've tried it with CopyOfTree = copy.deepcopy(self.myTreeCtrl) but this doesn't work. Is there a way to deep copy the TreeCtrl?...

wxpython shell enable uparrow to retrieve commands

python,python-2.7,wxpython
I am using Shell from wx.py.shell, it is working good. But how do I enable the Python prompt like up arrow key feature. When I use arrow key inside shell, cursor goes up and down, while I want it to step through the last commands. I see from doc that...

align wx.DrawCircle to the center of the frame

python,python-2.7,wxpython,wxwidgets
Hi there I wanted to draw a circle at the center of the Frame. Is there anything like wx.Align_Center I can use with wx.DrawCircle Below is my code. #!/usr/bin/python # points.py import wx import random class Points(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(250, 150)) self.Bind(wx.EVT_PAINT, self.OnPaint)...

WxPython Combobox string not returning correctly

python,wxpython
Whenever I try to return a string from a ComboBox in WxPython, it doesn't return the string correctly, it returns it like this: <bound method CommandEvent.GetString of <wx._core.CommandEvent; proxy of <Swig Object of type 'wxCommandEvent *' at 0x27e818> >> And I want it to return string inputted into the Combobox:...

Creating menus using wxpython

python,wxpython
I created a menu using: fileMenu = wx.Menu() fileMenu.Append(ID_NEW, "&New\tCtrl+N", "Creates a new file") I can access New by clicking it on the menu or by clicking Ctrl+N. My question is: What is the & stand for? if I delete it everything is still working. However all guides still use...

Why sizer in wxPython not work when I bind size_event to a handler function?

wxpython
import wx class MyFrame(wx.Frame): def __init__(self, parent): self.parent = parent super(MyFrame, self).__init__(parent, -1, 'Test') # create a base panel self.panel = wx.Panel(self) self.panel.SetBackgroundColour('blue') vbox = wx.BoxSizer(wx.VERTICAL) # create a sub-panel 1. self.panel_1 = wx.Panel(self.panel, -1) self.panel_1.SetBackgroundColour('yellow') vbox.Add(self.panel_1, 1, wx.EXPAND) # create a sub-panel 2. self.panel_2 = wx.Panel(self.panel, -1) self.panel_2.SetBackgroundColour('pink') vbox.Add(self.panel_2,...

wxpython: Hide one of splitterWindow panels

python,python-2.7,wxpython,show-hide
I have a frame containing wx.SplitterWindow with two panels as its children. I want to hide one of the panel with a button(show/hide button) click i.e, First panel should hide and the second panel should occupy the whole frame with the sash gone. Clicking the button again should show the...

WxPython using Listbox and other UserInput with a Button

python,listbox,wxpython,web-crawler
I am trying to create a web crawler based on specific user input. For example, the User Input I am trying to receive is from a ListBox and a text field. Once I have that information, I would like the user to click a button to start the search with...

wxPython DrawRectangle Not Filled with Black Background

python,wxpython,drawing
I am using python 2.7 and the most up to date version of wxpython for it (3.0). I am trying to draw a rectangle that is not filled. When I run the code below, it draws a red rectangle with the proper thickness, but the inside is white and not...

wxpython drawing to window causes message dialogs to crash

python-2.7,wxpython
im making a little paint app using wxpython like this: from wx import * class Canvas(ScrolledWindow): def __init__(self, parent): ScrolledWindow.__init__(self, parent, ID_ANY,(0, 0), size=DefaultSize, style=wx.SUNKEN_BORDER) self.SetBackgroundColour('#666666') self.sizer = BoxSizer() self.EnableScrolling(True,True) self.window = Window(self, size=(200,200)) self.window.SetBackgroundColour('#ffffff') self.sizer.Add(self.window) self.SetSizer(self.sizer) self.SetVirtualSize((1000,1000)) self.SetScrollRate( 1, 1 ) self.Bind(EVT_PAINT,...

wxPython Textentrydialog value

python,wxpython,messagedialog
when I try to use the value I get it gets an empty string dlg = wx.TextEntryDialog(None, 'Enter User Name:', 'Log in') if dlg.ShowModal() == wx.OK: self.user=dlg.GetValue() ...

wxPython, Getting input from TextCtrl box to send to Notepad

python,windows,wxpython
I am trying to create a simple invoice program for a school project. I have the basic layout of my program. The large text boxes on the left are for the invoice, and the ones on the right are for the price of that input. I want the text boxes...

wxPython MVC working with GUI

python,model-view-controller,wxpython,observer-pattern
I have a working program in 1 class. I wish to convert it to MVC pattern. I've implemented observer design as shown here and i opened 3 .py files for Model, View and Controller. I'm having trouble understanding what goes where. For example: this code in the original class helpMenu...

wxpython tooltip at specific coordinates

wxpython,tooltip,coordinates,paint
I have seen lots of similar questions and those answers are what has gotten me this far. I have an application where all all object are created via DC, so they are all all drawn. (I have had much experience with sizers and 99% of the time sizers ROCK but...

wxPython Paint Damaged, Clipped area

python,wxpython,drawing,wx
I have the following simple code (click the pink box and you can move it around with your mouse while holding down the left mouse button). import wx class AppPanel(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id) p = MovablePanel(self, -1) self.i = 0 self.Bind(wx.EVT_PAINT, self.OnPaint, self) def OnPaint(self, event):...

wxPython - Set Items in ListCtrl and Get Selected Item

python,wxpython
I have the following code for creating a ListCtrl called "browser list". self.browserList=wx.ListCtrl(panel, pos=(20,150), size=(250,100), style.wx.LC_REPORT|wx.BORDER_SUNKEN) self.browserList.InsertColumn(0, '') self.browserList.InsertColumn(1, 'Browser: ') self.browserList.SetColumnWidth(0, 50) self.browserList.SetColumnWidth(1, 200) I wante to add the following to add these strings as items, but it puts it in the 1st column, whereas I need it in...

Error in select all/ unselect all checkboxes code wxpython

wxpython
Hi I am trying to implement a GUI where selecting/unselecting 1 check box titled "ALL" will select/unselect the rest of the checkboxes. However this code does not work and i cant seem to find out why. Here is my code: import wx import calendar,datetime import os class MainFrame(wx.Frame): def __init__(self,...

wxPython Notebook Pages

python,wxpython
I'm trying to add code to a notebook page. It works fine in a frame, but in a notebook page derived from Panel it does not. I need some help understanding panel and help fixing my code. Here is the code for the notebook page: class PageOne(wx.Panel): def __init__(self, parent):...

wxPython wx.Frame with wx.Dialog effect

dialog,wxpython,frame
I want to have a wx.Frame that has the effect that the wx.Dialog has, that you cant unfocus it until it closes itself, makes it above all other. I need to use wx.Frame and not wx.Dialog because when using wx.Dialog and calling the dialog.ShowModal() it doesn't continue the code after...

Running a packaged Python program in Ubuntu

python,wxpython,cx-freeze,dpkg
I have written a python program and cx_freeze it so that it can be moved to other Linux machine to execute, everything went fine, except the following After freezing all my python code, I then dpkg build it and marked /usr/bin/myProgram as my installation directory, everything went fine, I can...

How to draw a rectangle and put a text inside it

wxpython
I am using wxPython for first time. My requirement is to create a rectangular box and write some text in it. I tried to achieve the same but the rectangular box is not getting rendered in the windows frame: #!/usr/bin/env python import wx class Example(wx.Frame): def __init__(self, *args, **kwargs): super(Example,...

wxPython Refresh a plot with another graph by a button event

python,matplotlib,plot,wxpython
I set up a complete GUI and I already set up plots with no content. I have a list of parameters which are needed to calculate the plots content. The graph should be plotted by hitting one button. plotting different graphs by changing the parameters should also be possible. So...

Using wxPython Menus, ID: What does it mean and Which should I use for X?

python,wxpython
I have a wxPython app I'm working on. I'm working on the menu and menu bars. So far here is the code I have: class Frame(wx.Frame): def __init__(self, title): wx.Frame.__init__(self, None, title=title, pos=(150,150), size= (350,200)) self.Bind(wx.EVT_CLOSE, self.OnClose) menuBar = wx.MenuBar() menu = wx.Menu() m_exit = menu.Append(wx.ID_EXIT, "&Exit\tAlt-X", "Close window and...

How to format label in wxPython's StaticBox?

wxpython
I want to set the label (header?) of the wx.StaticBox widget in a 16pt bold font. For a normal wx.StaticText I would do this (thanks to this post): my_font = wx.Font(16, wx.DEFAULT, wx.NORMAL, wx.BOLD) text = wx.StaticText(self.panel, label='My Text') text.SetFont(my_font) How is this done for the wx.StaticBox?...

Get a return value of a function in another function which is an event

python,python-2.7,wxpython
I'm confused in accessing a value from a function(event) in an another function(event).My code is something like this. def OnSelect(self,e): i=GetString() return i and i have an another event function, def OnStart(self,e): "this function outputs based on return value from function OnSelect()" Based on the events selected on OnSelect(),The function...

PyInstaller IO Error accessing zip

wxpython,pyinstaller,zipfile
I have a wxpython program where I keep the picture files in a zip file. Program runs fine while running by python. But when I run pyinstaller to produce exe file, I get IO error. Here is my program. import zipfile import wx from PIL import Image from StringIO import...

Using time.sleep to Update Wxpython GUIs without GUI “Freezing” [duplicate]

python-2.7,user-interface,wxpython
This question already has an answer here: Keeping GUIs responsive during long-running tasks 9 answers I have three separate GUIs that I wrote using wxpython. def __init__(self, app): self.gui1= Gui1(None) self.gui1.Show() self.gui2= Gui2(None) self.gui2.Show() self.run_game() def run_game(self): for i in range(0, 100): time.sleep(0.5) self.gui1.method1() self.gui2.method1() if __name__ == '__main__':...

wxPython Draw A Triangle

python,wxpython,drawing
I understand that this is a very simple question, but how do you draw a triangle using wxpython? A simple example would be much appreciated. I tried using dc.DrawPolygon(self, points, xoffset, yoffset, fillStyle), but I didn't know what to pass in for fillstyle. All my efforts resulted in odd error...

how to play SWF in wxpython's panel in linux

python,linux,wxpython,swf
i'm stuck again, now i'm stuck with flash player in wxpython linux. i'm using wxpython 2.8.12 and python 2.7 in linux mint. wxpython in windows has wx.lib.flashwin.FlashWindow. all you need to do is from wx.lib.flashwin import FlashWindow i learn it from here but how about in linux? is there any...

wxPython - implementing wx.EVT_TEXT_PASTE

python,wxpython
i'm creating a wx.PyValidator for my textboxes: class IPValidator(wx.PyValidator): "Validator for validating IP addresses" def __init__(self): super(IPValidator, self).__init__() self.Bind(wx.EVT_TEXT_PASTE, self.OnPaste) def Clone(self): """Cloning the validator""" return self.__class__() def Validate(self, win): """the validate function""" return self.OnValidate(self.GetWindow().GetValue()) def OnValidate(self, text): """returns True or False about the given text""" return re.match(text, ip_pattern) def...

wxpython: Transparent panel in wxpython

python,python-2.7,wxpython
It is possible to make the whole frame transparent using SetTransparent(val) in wxpython. But can I make a single panel in it to be transparent? I tried using panelobj.SetTransparent(val) but that didnt work. import wx class MyFrame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title,size=(250, 250)) topPanel = wx.Panel(self)...

WxPythonAdd List to Grid Sizer

wxpython,sizer
I have a list of images (wxImg) which I want to add to a grid sizer. I  cannot figure it out how to add them. Here is my piece of code. import wx class MyPanel(wx.Panel): def __init__(self, *args, **kwargs): wx.Panel.__init__(self, *args, **kwargs) msz = wx.BoxSizer(wx.VERTICAL) gs = wx.GridSizer(5, 5, 0,...

python wx changing windows size

python,wxpython
I have a wx gui application. the user can change the window size with the mouse (same as any other window) the problem is that my window isn't auto adjust to the new size of the window. How do I do that? iv'e looked it up but all guides are...

wxPython — BoxSizers not placing things correctly

python,user-interface,wxpython,boxsizer
I can't figure out what I'm doing wrong. I just made the jump from Tkinter to wxPython and I'm trying to figure out BoxSizers. I'd look this question up, but I don't even know what to look up. This panel is filling the space of a Frame, it's supposed to...

WxPython not rendering correctly

python,wxpython
I create a WxPython notebook after a call from a menu item, but unfortunately it's not rendering correctly (only a little blue shape in the corner is visible). I have to manually resize the window and it pops back to working order like the second picture. Code: def load_notebook(self): panel...

sizing problems embedding matplotlib figure in wxpython GUI

python,matplotlib,wxpython
I have some code that generates a plot. This code was written using pylab's interactive mode, but at this point I need to re-write the code so that I can embed the plot into my wxPython GUI. The problem is, the figure shows up squished down into a small default...

Python - ObjectListView Filter

python,filter,wxpython,objectlistview,objectlistview-python
I have read here and I'm trying to filter ObjectListView by using Filter.Predicate(booleanCallable) as follows: class Book(object): def __init__(self,name,author,length): self.name=name self.author=author self.length=str(length) class ObjectDataView(ObjectListView): def __init__(self, parent): ObjectListView.__init__(self, parent, size=(400,400), pos=(0,0), style=wx.LC_REPORT | wx.SUNKEN_BORDER) self.SetColumns([ ColumnDefn("Name", "left", 400/3, "name"), ColumnDefn("Author", "left", 400/3, "author"), ColumnDefn("Length", "left", 400/3,...

wxPython: Data binding with controls

python-2.7,wxpython,wxwidgets
How can I databind the value self.text in MyModel to the controls in the wx.Frame? When the text control changes the text I would like the label to change aswell as the contents of the other text control automatically. (ideally without having to write any code if that's possible) Note:...

Add a vertical scrollbar to a wxFrame accross multiple wxPanels

python,wxpython,scrollbar,gnuradio
I want a vertical scrollbar throughout the frame (Top Block). I am able to get vertical scrollbars for the individual panels - Here both the plots are threads plotted by the same class. Here is the code which sets up the top block in gnuradio - class top_block_gui(gr.top_block): def __init__(self,...

Mac OS Quit Application menu label same as python script name

python,osx,wxpython,py2app,pyobjc
When I run my wxPython app in Mac OS X, the "Quit" menu item under the Application menu has the label "Quit Myapp", where myapp.py is the name of the main python script. If I rename it to, for example, coolapp.py, the label on the menu item becomes "Quit Coolapp"....

Event get value in wxpython

python,user-interface,events,wxpython
I have a problem with using wxpython. I try to get a value from a column and I want to output to another column too after I hit a button. However, I dont know what I code to add to make this work. My current code is like this: import...

Changing Font Color of wxpython Radio Button

python,radio-button,wxpython
I am using wxpython version 2.9.4.0 and python 2.7.9. I am trying the change the color of the text for a radio button. I initialized by: button = wx.RadioButton(panel, -1, 'Line', (200, 300)) I was able to change the color around the radio button by: button.SetBackgroundColour((150, 150, 150)) But this...

wxPython: Dynamically Flow Buttons to Next Row on Window-Resize

python,python-2.7,wxpython
The following wxPython sample code is meant to create some buttons and then add them to a horizontal panel in such a way that the buttons should flow to a new row when they no longer fit in the panel. In addition, the buttons should change position (increase/decrease the number...

Differences between MessageBox, Dialog and PopUp

wxpython
I'm making a cyclic full-screen wizard for a kiosk and I want to have custom messageboxes/dialogs/popups to appear according to errors in the service or Yes/No alerts. I already have a working prototype using wx.PopUp and wx.PopUpTransient classes, but now I want to customize these windows (bitmap border with adaptive...

Expand child elements of wx.GridBagSizer on Panel on wx.Notebook

python,layout,wxpython,wxwidgets,wx
I have a simple application with wx.Notebook, it looks like this: To lay out its child elements, I used wx.GridBagSizer - and it works perfectly. However, I encountered a small but annoying issue. When I expand the window of wx.Notebook, it does not expand all the elements and results in...

wxPython — StaticBox Sizer resizing Static Boxes

python,user-interface,wxpython
Here is a minimal example of my code that should run by itself -- run as is, everything is laid out how I want, 3 rows of nodes spaced evenly: import wx def createBoxes(): outVSizer = wx.BoxSizer(wx.VERTICAL) outHSizer = wx.BoxSizer(wx.HORIZONTAL) outVSizer.AddStretchSpacer(1) outHSizer.AddStretchSpacer(1) sizer = wx.FlexGridSizer(rows=3, cols=3, vgap=35, hgap=20) box =...

Wxpython Radio Button Preselected

python,user-interface,radio-button,wxpython
I have 3 wxpython radio buttons. When run, the first button (Value A) is already selected. How do I make it so no buttons are selected initially? self.rb1 = wx.RadioButton(panel, -1, 'Value A', (50, 10), style=wx.RB_GROUP) self.rb2 = wx.RadioButton(panel, -1, 'Value B', (10, 30)) self.rb3 = wx.RadioButton(panel, -1, 'Value C',...

changing data in list on button press

python,wxpython
in wxpython how do you update the information in the list when the user presses the button... the code i have is this : ButtonImage8 = "Images/GUI/MP3Player/button_reload.bmp" ButtonImageBMP8 = wx.Image(ButtonImage8, wx.BITMAP_TYPE_ANY).ConvertToBitmap() button8 = wx.BitmapButton(BUTTONpanel8, id=wx.ID_ANY,bitmap=ButtonImageBMP8, size=(40, 40), pos=(0, 0),style=wx.NO_BORDER) button8.Bind(wx.EVT_BUTTON, self.Music_Reload) BUTTONpanel8 = wx.Panel(self, -1, pos=(280, 160), size=(40, 40), style=wx.NO_BORDER)...

Second wx.Frame inside a wx.Frame - messed up layout

inheritance,wxpython,frame
I have a wx.python program which uses a wx.Frame in a class called Main. On this, I have a Menu bar, with "preferences", the idea is to click this menu to open up another wx.Frame for config boxes etc. However the problem is that although I believe the coding is...