wxwidgets

WXWidgets Event Arguments

拟墨画扇 提交于 2019-12-24 11:53:51
问题 I'm trying to set up a window in WXWidgets with a grid of buttons. Each of these buttons will open another window. Now I know I can do this by having the call to each window in a separate function depending on the button that was pressed. But that seems a bit inefficient. What I want to do is have each of these buttons call the same function when clicked, but pass an ID which will be used to determine which window is opened up. The basic code I'm using is as follow (bits are stripped out, I

How can I remove widgets from WxHaskell panel

心已入冬 提交于 2019-12-24 10:17:03
问题 My google-fu has failed me. How can I remove widgets that I've added to a Panel () ? For example, in the following, I want the controls -panel to become empty again. buildGUI = do f <- frame [ text := "Hello" ] controls <- panel f [] ctext <- staticText controls [ text := "Foo" ] set controls [ layout := margin 5 (widget ctext) ] set f [ layout := widget controls ] {- delete ctext ? How? -} return () (I'm trying to build a dynamic GUI, and I need to get rid of the old controls when it updates

Side effects of handling EVT_PAINT event in wxPython

别等时光非礼了梦想. 提交于 2019-12-24 07:36:06
问题 Whenever I handle EVT_PAINT event by binding it to a function some problem occures the frame/window opens up but it cannot be closed when I click on the close option on the top-right corner of the frame. Can any one tell me what can be the reason for this ??? Apart form that there is a lot of flicker that occures. The purpose of the code is somewhat like this. I have a Main Frame class which holds a panel. In that panel I have a wxPython Notebook. There are two pages in the notebook. Each

Give wx.StaticBitmap a transparent background? wxpython

ε祈祈猫儿з 提交于 2019-12-24 06:44:10
问题 I have an image that has a white background, how can I make this background invisible? Its in a wx.StaticBitmap wx.StaticBitmap(self, bitmap=wx.Bitmap('images/myimage.png'),pos=(0,0)) 回答1: By invisible, I assume you mean transparent so that whatever is behind the image shines through. This is not a function of widgets, but whatever you use to edit your image. You don't say! I use microsoft visual studio. Here's a screenshot. Notice how the background, shown in a sort of blue-green in the

Give wx.StaticBitmap a transparent background? wxpython

感情迁移 提交于 2019-12-24 06:44:07
问题 I have an image that has a white background, how can I make this background invisible? Its in a wx.StaticBitmap wx.StaticBitmap(self, bitmap=wx.Bitmap('images/myimage.png'),pos=(0,0)) 回答1: By invisible, I assume you mean transparent so that whatever is behind the image shines through. This is not a function of widgets, but whatever you use to edit your image. You don't say! I use microsoft visual studio. Here's a screenshot. Notice how the background, shown in a sort of blue-green in the

wxPython: displaying multiple widgets in same frame

ⅰ亾dé卋堺 提交于 2019-12-24 01:27:40
问题 I would like to be able to display Notebook and a TxtCtrl wx widgets in a single frame. Below is an example adapted from the wxpython wiki; is it possible to change their layout (maybe with something like wx.SplitterWindow ) to display the text box below the Notebook in the same frame? import wx import wx.lib.sheet as sheet class MySheet(sheet.CSheet): def __init__(self, parent): sheet.CSheet.__init__(self, parent) self.SetLabelBackgroundColour('#CCFF66') self.SetNumberRows(50) self

Arranging the panels automatically in wxPython

依然范特西╮ 提交于 2019-12-24 00:35:39
问题 Level: Beginner I am developing a GUI with wxPython on Windows OS. I have some problems with arranging the panels. I GUI looks like below image (Of course the menu bar and the title bar is omitted in the image). I would take some time to explain how I create this GUI. First I get the screen size with the wx.DisplaySize() . Then I adjust my panels accordingly using pos=() . There are main 4 panels named panel-1 to panel-4. Each of this panels contains subpanels. The number of subpanels is not

How to enable multisampling for a wxWidgets OpenGL program?

南笙酒味 提交于 2019-12-23 21:22:52
问题 Multisampling is a way of applying full screen anti-aliasing (FSAA) in 3D applications. I need to use multisampling in my OpenGL program, which is currently embedded in a wxWidgets GUI. Is there a way to do this? Please respond only if you know the detailed steps to achieve this. I'm aware of enabling multisampling using WGL (Win32 extensions to OpenGL). However, since my OpenGL program isn't written in MFC (and I want the code to be multi-platform portable), that's not an option for me. 回答1:

WxWidgets custom events

拜拜、爱过 提交于 2019-12-23 18:33:46
问题 I'm trying to use a custom event in my WxWidgets C++ application, like described here. In the constructor of my wxApp: Connect(wxID_ANY, wxCommandEventHandler(APP::OnMyEvent)); Then the function that should catch the event: void APP::OnMyEvent(wxCommandEvent& event) { exit(0); //testing } Finally, to test it: wxCommandEvent MyEvent(wxEVT_COMMAND_BUTTON_CLICKED); wxPostEvent(this, MyEvent); I launch the thing...but it seems that the event is not posted or not caught. Does someone understand

Any tips on reducing wxWidgets application code size?

徘徊边缘 提交于 2019-12-23 17:52:20
问题 I have written a minimal wxWidgets application: stdafx.h #define wxNO_REGEX_LIB #define wxNO_XML_LIB #define wxNO_NET_LIB #define wxNO_EXPAT_LIB #define wxNO_JPEG_LIB #define wxNO_PNG_LIB #define wxNO_TIFF_LIB #define wxNO_ZLIB_LIB #define wxNO_ADV_LIB #define wxNO_HTML_LIB #define wxNO_GL_LIB #define wxNO_QA_LIB #define wxNO_XRC_LIB #define wxNO_AUI_LIB #define wxNO_PROPGRID_LIB #define wxNO_RIBBON_LIB #define wxNO_RICHTEXT_LIB #define wxNO_MEDIA_LIB #define wxNO_STC_LIB #include <wx/wxprec