Thanks for the reply Jeff... I did some digging and found after using the method you provided,
in an earlier thread, such as...
print [x for x in dir(event)]
I found where event.Column and event.GetIndex() is passed to the user defined event handler function so cell cords can be easily achieved.
So seems to be solved.
Thanks -- Andrew
I have found in the demo package... an editable list Ctrl with by use of what is called a mixin. I am unfamiliar with mixins and am unable to find documentation. Is there a way to capture the event of a row,col (cell)?
thanks -- andrew
Hi, I am working with a wx.Python ListCtrl attempting to edit data in the second column. Is there a way of detecting which column,row has been clicked?
thanks -- andrew
Tried using p.search
worked.
SOLVED
--Andrew
Hi,
working with the 're' module I am having some difficulty figuring out simple RE. here is the code.
p = re.complie('amb')
m = p.match("mamba")
print m.group()
according to the following documents ...
http://www.amk.ca/python/howto/regex/regex.html#SECTION000300000000000000000
http://gnosis.cx/publish/programming/regular_expressions.html
there should be a pattern match like... 'amb' but I am getting 'None' back.
Can someone help explain the reason?
Thanks greatly for any help
-- Andrew
Hi,
I am looking for a Python module that would allow rasterizing of SVG files. I have looked extensively on google with no luck other than a module name I cannot seem to find called
rsvg. Has anyone heard of this as a Python module? And if so where? Or is there something else I could try?
Thanks -- Andrew
Yes, that helped by seeing the path variable. Actually I had looked all through the directory structure looking for it but seems, come to find out, the folder name seems to be used as a reference. Then __init__ within directory is found and from there I can find the related scripts inorder of inclusion and such.
Thanks for your help -- Andrew
Hi,
I am attempting to view the source code of a module i have imported to a project but am having trouble finding its source. I had previously thought the command 'import' would look for a script in python paths named the same as the import name plus a '.py'. But, now I have a module that must be named differently and I am wondering how python finds the correct module to use and also how that I would go about finding the module?
Thanks -- Andrew
In process of attempting to build a CSS editor. I was wondering if anyone could lead me to a way to highlight CSS for a rich GUI control in wxPython specifically?
Also I would like to parse,serialize, validate and write CSS to file. I did find cssutils but was getting errors when parsing. They did not seem to be volitile errors but no sure if I should explore it futher of find something else... if there is something else.
Any Help would be greatly Appreciated -- Andrew
I have done some extensive searching for a tutorial or sample code for context menus in wxPython to no avail. Could someone post a link or a tad of sample code to get me started?
Thanks in advance -- Andrew
wx.App(False) was Bumsfeld's trick, not mine.
If you click the "Toggle Plain Text" link in the code header, it will turn into paste-able text.
Jeff
Ahh... Yes i see... Doh!
Also, if you work with wxPython Gui Toolkit you need to use False in this line:
app = wx.App(False)
This did the trick, thanks! -- Andrew
Thanks Jeff wx.App(False) did the trick!
Yeah, on the code wrap...thanks for the tip. I missed and used HTML style tag and without code type attribute. Oops.
BTW is there some way of cut and pasting line numbered code from web browser into an editor?
Currently I have to manually remove all the line numbers being carefull to preserve indent. Hoping there is an easier (faster) way.
--Andrew
I am writing simple Python modules and when running one containing errors in the script the console window that displays the error just flashes up for a split second and disapears. Is there any way to keep this window shown?
I am working on Windows XP in the Eclipse environment using PyDev. I have tried Boa Constructor with the same issue there.
Thanks in advance -- Andrew
Seems Eclipse will give indentation errors if the indent are not all spaces or tabs. If they are mixed problems occur.
I tried using boa constructor but console window will hide real quick just like Eclipse.
Just wanted to let you know Jeff that it was not a result of your mods that were causing problems.
Starting to get a better hold on things now. Thanks for your help.
<code>
import wx
class Layout(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer_two = wx.BoxSizer(wx.HORIZONTAL)
self.panel_one = wx.Panel(self, -1)
self.panel_two = wx.Panel(self, -1)
self.panel_two.SetBackgroundColour(wx.RED)
self.button_one = wx.Button(self.panel_one, -1, label = "button 1")
self.button_two = wx.Button(self.panel_two, -1, label = "button 2")
sizer.Add(self.panel_one, 2, wx.EXPAND | wx.ALL, 3)
sizer.Add(self.panel_two, 1, wx.EXPAND | wx.ALL, 3)
sizer_two.Add(self.button_one, 1, wx.ALIGN_CENTER)
self.button_one.Bind(wx.EVT_BUTTON,self.Button_One_Click)
self.SetSize((400,120))
#self.Fit()
self.SetSizer(sizer)
self.panel_one.SetSizer(sizer_two)
self.Centre()
def Button_One_Click(self,event):
if self.button_two.IsShown():
self.panel_two.Show(False)
else:
self.panel_two.Show(True)
event.Skip()
app = wx.App()
k = Layout(None, -1, 'layout.py')
k.Show(True)
app.MainLoop()
</code>
Working with you code I am getting errors. I am using Eclipse IDE and when the script runs a console pops up and displays the error but hides itself so fast I cannot read it. Also not sure if I can step through program to see where error is occuring. Is Eclipse Ok or am I on the wrong path as far a editors go?
Thanks -- Andrew
Thanks Jeff I will work with what you have provided and try and wrap my head around it.
I did mean to allow clicking of the panel. Just wanted to see if it would work.
I added another button and for some reason they are now over lapping. Guess I have to explicitly position them? Well... maybe the sizer will cover that too.
import wx
class KeyEvent(wx.Frame):
def __init__(self, parent, id, title):
frame = wx.Frame.__init__(self, parent, id, title)
panel = wx.Panel(self,-1)
button1 = wx.Button(panel, -1, label="hide other button")
self.button2 = wx.Button(panel, -1, label="im just here to be hidden")
button1.Bind(wx.EVT_LEFT_UP, self.ButtonLeftUp)
self.Centre()
self.Show(True)
def ButtonLeftUp(self, event):
self.button2.Show(False)
event.Skip()
app = wx.App()
KeyEvent(None, -1, 'keyevent.py')
app.MainLoop()
Thanks for your replies...
-- Andrew
I have a small bit of code here I am working with. The goal I have set forth was to scale the size of panel to the frame. Does the frame have a size property that can be fetched? Are there functions or methods (not sure I know the difference yet) that will allow scaling to the size of the frame maybe a sizer?
import wx
class KeyEvent(wx.Frame):
def __init__(self, parent, id, title):
frame = wx.Frame.__init__(self, parent, id, title)
panel = wx.Panel(self, -1)
button = wx.Button(self, -1, label="click me")
panel.Bind(wx.EVT_LEFT_UP, self.PanelLeftUp)
self.Show(True)
def PanelLeftUp(self, event):
print "left click occured"
app = wx.App()
KeyEvent(None, -1, 'keyevent.py')
app.MainLoop()import wx
By setting the button to be child of panel I see the panel will scale to 100% of its container (the frame). This though is not reallly what I wanted since I am then unable to set the dimension on the panel. It stays 100% no matter if I change its size value when created. Also would like to be able to change value of pos after creation.
possible?
additionally if I set panel to be child of frame the program ceases to run?
-- Andrew
nevermind back now... just a little impatient i suppose.
thanks -- andrew
Well that does produce a nice list of 'em :)
Although would be helpfull to have some descriptions as well.
thanks -- andrew
Ahh, that makes sense...
I am working with wxPython attempting working with GUI Events in hopes of making some ground towards a CSS editor but have run into problems finding the Bind function of the EvtHandler Class as is referenced in a tutorial.
Any clues where to find Bind function and EVT types for Bind in the wxPython documentation?
I am unfamiliar with this syntax and am having trouble finding info about it...
void MyTextCtrl::OnChar(wxKeyEvent& event)
{
if ( isalpha( event.KeyCode() ) )
{
// key code is within legal range. we call event.Skip() so the
// event can be processed either in the base wxWidgets class
// or the native control.
event.Skip();
}
else
{
// illegal key hit. we don't call event.Skip() so the
// event is not processed anywhere else.
wxBell();
}
}
I get unfamillar with the first line where the :: is. could someone explain what type of operator or other this is?
also on execution get error right at this point.