bug in wx.choice and possibly other controls
"Pedro Cardoso" <[email protected]> Thu, 2 Sep 2004 23:43:53 +0100
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <[email protected]> |
Hi there is a bug in wx.choice and possibly other controls under linux
(under Windows the sample code works fine) the bug is that when the control
is invisible the label property becomes null when it should maintain the
value that the control has when it is visible.
Sample code:
using System;
using System.Drawing;
using wx;
namespace WindowsApplication1
{
public class Form1 : wx.Frame
{
private wx.Choice comboBox1;
const int ID_COMBOBOX1 = 1;
void OnSize(object sender, wx.Event e)
{
comboBox1.Hide();
this.Title=comboBox1.Label ;
comboBox1.Show(true);
}
public Form1(string title, System.Drawing.Point pos,
System.Drawing.Size size) : base(title, pos,
size,wx.Window.wxCAPTION|wx.Window.wxCLIP_CHILDREN|
wx.Window.wxRESIZE_BORDER| wx.Window.wxMAXIMIZE_BOX|
wx.Window.wxSYSTEM_MENU|wx.Window.wxCLOSE_BOX|wx.Window.wxMINIMIZE_BOX)
{
string[] comboBox1Items = {"one", "two"};
comboBox1=new wx.Choice(this, ID_COMBOBOX1, new
System.Drawing.Point(176, 72), new System.Drawing.Size(96, 21),
comboBox1Items);
comboBox1.Selection=1;
EVT_SIZE(new wx.EventListener(OnSize));
}
}
public class MyApp : wx.App
{
public override bool OnInit()
{
Form1 frame = new Form1("Form1",
wx.Window.wxDefaultPosition, new System.Drawing.Size(300,300));
frame.Show(true);
return true;
}
[STAThread]
static void Main()
{
MyApp app = new MyApp();
app.Run();
}
}
}
BUG: This code under linux never changes the title property when we resize
the window.
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click