I'm developing a GUI using wxPython (Boa Constructor IDE). My GUI has the following: Rich text control Start button Stop Button My requirement is that when I press the START button, numbers (1, 2, 3, etc.) should start printing in the text control; it should stop when I press the STOP button. Code and GUI are as shown. What changes do I need to make to meet my requirements? import wx import wx.richtext def create(parent): return Frame3(parent) [wxID_FRAME3, wxID_FRAME3BUTTON1, wxID_FRAME3BUTTON2, wxID_FRAME3PANEL1, wxID_FRAME3RICHTEXTCTRL1, ] = [wx.NewId() for _init_ctrls in range(5)] class Frame3(wx.Frame): def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, …

Member Avatar
Member Avatar
+0 forum 3

I have a wx.DatePickerCtrl with the dropdown popup window that allows the user to pick a date from the calendar. What I would l like to have my program do is process an event when the user has clicked on a day in the dropdown calendar. Unfortunately the only native event for this control is EVT_DATE_CHANGED and that event gets fired every time the user scrolls the month/year while looking for the date of their choice (firing the event many more times than I would like). I can't seem to access the popup window that is created below the datepickerctrl …

Member Avatar
Member Avatar
+0 forum 9

Hi, i am working on program that connect to database, and user then cans see, edit, insert and delete data in mysql database. I have problem whit update query, can somone help me whit this. User need to click on cell and enter/change data, then hit enter to save changes. import wx import wx.grid import MySQLdb class SimpleGrid(wx.grid.Grid): def __init__(self, parent): wx.Panel.__init__(self, parent) self.currentlySelectedCell = (0, 0) self.myGrid=wx.grid.Grid(self) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.myGrid, 1, wx.EXPAND) self.SetSizer(sizer) self.myGrid.Bind(wx.EVT_KEY_DOWN, self.onKeyPress) self.myGrid.Bind(wx.grid.EVT_GRID_SELECT_CELL, self.onSingleSelect) self.db = MySQLdb.connect("127.0.0.1", "usename", "password", "database") self.cursor = self.db.cursor() self.display() def display(self): data=(self.getData()) nrw=len(data) ncl=len(data[0]) self.nrw=nrw self.myGrid.CreateGrid(nrw+1, ncl) self.myGrid.SetColLabelValue(0, "idSetup") self.myGrid.SetColLabelValue(1, …

Member Avatar
Member Avatar
+0 forum 3

I have been teaching myself Python and wanted to create something useful while learning. I am using wxPython to create the interface. The app works if I use the mouse to click the buttons. I've been trying to get it to recognize operation key-ins like addition using the num pad +. It will register the keystrokes but the binding for the event handler to run the operation commands isn't working. I know this isn't the cleanest written code and would also appreciate any advice to clean it. I have the code on github. https://github.com/BridgeGuy/wxCalculator The calculator uses RPN similar to …

Member Avatar
Member Avatar
+0 forum 3

Hello, I am new to Python. I am learning boxsizer. I want to put two buttons on my panel. One at top right corner and one at bottom right corner. How do I achieve this? Thanks

Member Avatar
Member Avatar
+0 forum 3

The idea of this thread is to help the beginning wxPython GUI programmer with hints and helpful code. Please feel free to contribute! If you have any questions start your own thread! For info on wxPython modules see: http://www.wxpython.org/docs/api/wx-module.html

Member Avatar
Member Avatar
+2 forum 164

I am trying to toggle between the two toolbars (in two different panes) and couldn't do it with the code below. Not sure where the problem is.... I should only see "Page number" details when I click on "Read/Write" and "Hello world" when I click on "Write". Any ideas are very welcome!!! Here is the code: `Inline Code Example Here` import wx import wx.grid import wx.html import wx.aui from time import * import cStringIO import os import subprocess class PyAUIFrame(wx.Frame): def __init__(self, parent, id=-1, title="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN): wx.Frame.__init__(self, parent, id, title, pos, size, style) # …

Member Avatar
+0 forum 0

I am trying to toggle between the two toolbars and couldn't do it with the code below. Not sure where the problem is.... Any ideas are very welcome!!! Here is the code: `Inline Code Example Here` import wx import wx.grid import wx.html import wx.aui from time import * import cStringIO import os import subprocess class PyAUIFrame(wx.Frame): def __init__(self, parent, id=-1, title="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE | wx.SUNKEN_BORDER | wx.CLIP_CHILDREN): wx.Frame.__init__(self, parent, id, title, pos, size, style) # tell FrameManager to manage this frame self._mgr = wx.aui.AuiManager() self._mgr.SetManagedWindow(self) self._perspectives = [] self.n = 0 self.x = 0 tb4 = wx.ToolBar(self, -1, wx.DefaultPosition, …

Member Avatar
+0 forum 0

Hi, I am new to wxpython and trying to develop a small GUI interface (shown below). User selects a python script from "Browse run script" and when he/she hits the button "Execute RunScript", the script should execute via aardvark i2c interface. But I am not sure why it's not getting executed. I cannot even see any error messages after hitting the button. Any help is really appreciated!! import wx import wx.grid import wx.html import wx.aui from aardvark_py import * from time import * import cStringIO import os import subprocess self.runScript = wx.TextCtrl(self.panel,-1, "", wx.Point(100, 352), wx.Size(350, 20), wx.NO_BORDER) self.rsButton = …

Member Avatar
Member Avatar
+0 forum 3

Gtk-CRITICAL **: IA__gtk_range_set_range: assertion `min < max' failed I am getting this error when running my code wriiten using wxpython. Can anyone please explain what this error is.

Member Avatar
Member Avatar
+0 forum 5

# Heading Here # Trying to add a webcam fee to a panel inside of my wxpython GUI. I have buttons on the left currently, and a black panel on the right. I'm confused as to how to add a webcam feed to that panel? here is the code being used to the camera feed, I'm using pygame for it. pygame.camera.init() screen = pygame.display.set_mode((640,340)) cam = pygame.camera.Camera("/dev/video0", (300,220)) cam.start() while 1: image = cam.get_image() screen.blit(image,(200,100)) pygame.display.update() for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() the Gui panel i'm trying to add the feed to is like this. self.panel = …

Member Avatar
Member Avatar
+0 forum 1

I am writing a GUI flow using wxPython which has 4 pages (or more). They way I have approached is creating 4 (or more) classes with each class defining its own static (background) and dynamic images / content. In my application I would then programmatically create instances class required and capture events on that page. Based upon the event triggered the registered handler would destroy current class and switch to other class(page). So my code actually creates X classes with each class having its own method to set background / foreground content/images.Note I have created 2 classes (MainPanel, SecondPanel)that creates …

Member Avatar
+0 forum 0

Hi I am getting this error AttributeError: 'module' object has no attribute 'instancemethod' I searched through the forum and found answers for this error, but it is not working in my case. I am using python 2.6 and wxpython 2.8. The program which where running perfectly earlier are also showing this error now. Please help me I am stuck. here is the traceback Traceback (most recent call last): File "C:\Documents and Settings\SMStudent\Desktop\rect.py", line 1, in <module> import wx File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 45, in <module> from wx._core import * File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 6, in <module> new_instancemethod = new.instancemethod AttributeError: 'module' object …

Member Avatar
Member Avatar
+1 forum 9

I am trying to add a custom widget dynamically, multiple times. However, the widgets just stack up in the same place. I have tried several combinations of Layout() and Fit() and setSizerAndFit() after adding custom widget to the sizer Thank you for any help #!/usr/bin/env python # -*- coding: US-ASCII -*- # # generated by wxGlade 0.6.8 # import wx # begin wxGlade: dependencies import gettext # end wxGlade # begin wxGlade: extracode # end wxGlade class WordGroup(wx.Panel): def __init__(self, parent, id): wx.Panel.__init__(self, parent, id) self.parent = parent self.text_ctrl_1 = wx.TextCtrl(parent, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_NO_VSCROLL) self.label_1 = wx.StaticText(parent, wx.ID_ANY, …

Member Avatar
Member Avatar
+0 forum 1

Hi! I´m making a really big program of mail sending. However my last problem is the scrolling... The scroll bar don´t react to the mouse wheel and only functions when focusing in the bar , And that´s not user-friendly. how Can I achieve to make the scroll bar react with the scroll wheel. Here´s some relevant code: >class Man_at_files(wx.Frame):####dont pay attention to this bad Indent### > >def __init__(self,parent): > super(Man_at_files, self).__init__(None,pos =(10,50), style = wx.MINIMIZE_BOX | wx.SYSTEM_MENU | >wx.CAPTION|wx.CLOSE_BOX) > self.parent = parent > self.FrameUI() > self.SetTitle('Files added') > self.SetSize((350,600)) > self.Show() > >def FrameUI(self): > bmp = wx.Bitmap("img/close.png", wx.BITMAP_TYPE_ANY) …

Member Avatar
Member Avatar
+0 forum 1

The wxPython Phoenix project can be used with Python version 2 and version 3. The project applies pretty much the familiar wxPython code. Here we are testing a dragable borderless frame.

Member Avatar
Member Avatar
+3 forum 2

This small code example shows you how to approach the beginning concept of an very simple "IDE" for Python.

Member Avatar
+0 forum 0

Hi all, I'm working on a (Python) program which, in short, is a threaded TCP socket server which creates a new "tab" in a wx.Notebook widget for every incoming connection it sees. I've run into a strange problem where when I call notebook.AddPage(...), one of three things happens: 1. A "tab" correctly appears for the new page 2. No new "tab" appears, even though if I call GetPageCount() on the notebook, it returns the correct value 3. I receive the following error: "*** glibc detected *** python: double free or corruption (fasttop): 0x000000000164dbe0 ****" followed by a very long backtrace …

Member Avatar
Member Avatar
+1 forum 3

Dear members, i have a question. I created my software (with windows made with wxpython) and with py2exe I embed the icon into the exe. Since I would like to add the same icon file (or any other image) also as decoration in the window but I don't want to let the icon file outside the "None" zip file that py2exe generates, is there a way to do this? I mean, may I access a bitmap from the py2exe archive and use it inside a wxpython window? Sorry but I don't know how else to explain it. Thanks for your …

Member Avatar
Member Avatar
+0 forum 1

Method onPaint does not change the color. Does anyone know why? (there are no errors received) # explore the wxChoice widget # a simple ComboBox (dropdown box) that combines a ListBox with an EditBox # can't get the self.onPaint method to work!!!!! import wx ID_CHOICE = 120 ID_PANEL = 130 class MyFrame(wx.Frame): def __init__(self ): wx.Frame.__init__(self, None, -1, 'wxChoice test', size=(250, 200)) self.panel = wx.Panel(self, ID_PANEL) colorList = ['red', 'green', 'blue', 'yellow','white'] # create the dropdown box self.choice = wx.Choice(self.panel, ID_CHOICE, choices=colorList) # select item 1 = 'green' to show self.choice.SetSelection(1) self.bgcolor = self.choice.GetStringSelection() self.panel.SetBackgroundColour(self.bgcolor) # new event handler wxPython …

Member Avatar
Member Avatar
+0 forum 1

Hello all, I have been searching for some time to find the most appropriate enviroment to draw lines and simple tri's / quads in three dimensional space. I have recently experiemented with the floatcanvas class in wxpython and I really like it for 2D work, but extending it into the third dimension (by mapping 3d points to a 2d plane then calculating the order elements should be drawn) turned out to acheive rather poor results. I am a structural engineer, and write a number of small applications to make like easier for myself for designing structures etc. ALmost all structures …

Member Avatar
Member Avatar
+0 forum 5

i searched a llot but in vain. can anyone help me with how to include code written using GTK+ as module in a code that uses wxpython as toolkit. any help whatsoever is appreciated.

Member Avatar
Member Avatar
+0 forum 1

Hey guys, My question is pretty simple but I haven't been able to run across it in any of the examples I've seen online. I want to basically have a GUI that asks some questions with comboboxs. I would like it to be where the one at top is the only one that you can choose from, and the choice from the first combobox would lock out certain choices in the next comboboxs. I don't know how to initially "lock" a combobox. I do know how to simply take the choice out of the latter comboboxes, but I would rather …

Member Avatar
+0 forum 0

I want to be able to have a set of panels of vertical panels that remain the same size, but I want to have a vertical scroll bar that will allow me to scroll in the window. Right now I'm using a wx.ScrolledPanel and adding panels to that and putting them in the sizer but nothing really shows up on the screen import wx import wx.lib.scrolledpanel as scrolled class josh(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, wx.GetApp().TopWindow, title='Title',size=(800,600)) arr= ['Q1.......','Q2.......','Q3.......','Q4.......','Q5.......','Q6.......','Q7..............','Q8..........'] scroll=scrolled.ScrolledPanel(self, -1) #scroll.SetScrollbars(1,1,1,1) panelList = [] commentList = [] count = 1 sizer = wx.BoxSizer(wx.VERTICAL) for p in arr: panelList.append(wx.Panel(scroll ,-1, …

Member Avatar
+0 forum 0

hey if anyone knows how to open open window when we click on open option in menu bar of gui which is created by boa constructor.

Member Avatar
+0 forum 0

(<type 'exceptions.NameError'>, NameError("global name 'MenuPage' is not defined",), <traceback object at 0x028BEC38>) The MenuPage contains buttons to All functions of the PDF shuffler software. This is one such function which retirieves Information about the PDF files. Problem is, It executes once, goes back to MenuPage , then again if i click on the same function, it again executes but afterwards gives the above exception, dunno why?

Member Avatar
Member Avatar
-1 forum 9

Friends, kindly help me how to update the progress bar in WX Widgets python while copying folder in windows... i tried searching a lot.. please do help me out.. Thanks in advance! Ganesh R

Member Avatar
Member Avatar
+0 forum 1

I'm trying to create a wx.ListCtrl with a searchable header. I've been looking through the listctrl mixins, but I really don't have the wx expertise needed. I'm thinking I need to paint a textctrl using a dc object, but other than that I'm lost. Any ideas?

Member Avatar
+0 forum 0

Hi, I have the a situation here . My motive : Hiding one panel and showing another. Whats Working :Layout wise , my app is behaving like i want it to . The Problem : After the I hide one panel and show another , the button in this panel (process button) is still pointing to the funtion binded with "OUT" button . I am providing the program below. 1) Launch it . 2) Press "Process" button. Then press "Out" Button . 3) U will see old panel come back. Again press "Process" button . 4) Observe that the button …

Member Avatar
Member Avatar
+0 forum 1

I have create in MySQdb a DB with a table named example,in this table i want to save a name, this name is in Greek language.My problem is thw follown when i try to save the name instantly without use textctrl, its ok but when i use textctrl i take error.Look the code: Can anyone hel me please i have try encoding in utf-8,decoding in utf-8, to unicode but nothing. [CODE] import os import math import random import wx import MySQLdb import sys APP_SIZE_X = 500 APP_SIZE_Y = 300 # -*- coding: utf-8 -*- class MyFrame(wx.Frame): def __init__(self, parent, id, …

Member Avatar
Member Avatar
+0 forum 2

The End.