Tkinter.Text widget - how to get text cursor position?
Is it possible to get position (in numbers) of the insertion cursor? As I understood, Text widget uses mark named INSERT to store it, which is available globally by just referencing INSERT, but how could I get actual coordinate numbers of the mark? I need this because I want not just to insert string at, but to examine text before and after the insertion cursor. I can probably use .get() to extract the halves of text before and after cursor, but it'd be better just to know the position. Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter.Text widget - how to get text cursor position?
Alex9968 wrote: > Is it possible to get position (in numbers) of the insertion cursor? As > I understood, Text widget uses mark named INSERT to store it, which is > available globally by just referencing INSERT, but how could I get > actual coordinate numbers of the mark? > I need this because I want not just to insert string at, but to examine > text before and after the insertion cursor. I can probably use .get() to > extract the halves of text before and after cursor, but it'd be better > just to know the position. > > Thanks It's .index() Problem was that it's missed in Tkinter reference: a GUI for Python -- http://mail.python.org/mailman/listinfo/python-list
GUI toolkits with Tkinter's .pack() alternative
Hi all, I use Tkinter's Pack widget geometry manager (I really prefer it over using visual GUI designers), so my question is which other GUI toolkits have similar functionality. Secondly, I like the detailed widget borders configuration possible in Tkinter, which can be used to tweak GUI look, and wonder if other toolkits support it. With Tkinter's case, I like the resulting (tweaked) look in Windows, but I'm afraid it can be quite different (and ugly) on other platforms. (The reason I ever consider moving from Tkinter is some inconveniences, involving for example window scrolling, plus its smaller amount of widgets compared to some other toolkits, plus its (rumored) ugly look on certain environments. I will not necessary change the toolkit, but I have to consider it) Could anyone with experience in different toolkits help, please Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: GUI toolkits with Tkinter's .pack() alternative
Guilherme Polo wrote: > 2008/3/26, Alex9968 <[EMAIL PROTECTED]>: > >> Hi all, >> >> I use Tkinter's Pack widget geometry manager (I really prefer it over >> using visual GUI designers), so my question is which other GUI toolkits >> have similar functionality. >> > > The geometry manager isn't related to using GUI designers tools at > all. And each toolkit has it's own way to do the things, wxPython uses > sizers, PyGtk uses containers. > Well, the geometry manager isn't *directly* related to using GUI designers, but as Pack arranges widgets automatically, using GUI designers isn't required, while with geometry managers that don't, GUI designers are necessary (if you start placing widgets programmatically, you'll end up reinventing something like Tkinter's Pack or Grid geometry manager). I hope I can be understood clearly this time ;-) >> Secondly, I like the detailed widget borders configuration possible in >> Tkinter, which can be used to tweak GUI look, and wonder if other >> toolkits support it. With Tkinter's case, I like the resulting (tweaked) >> look in Windows, but I'm afraid it can be quite different (and ugly) on >> other platforms. >> > > You sure can, but differently. > I suppose any toolkit allows setting parameters like "no border", "flat border" and "3d border", but which ones can set ANY type of border to ANY widget like Tkinter does? For example set GROOVE border to buttons and text widgets (instead of traditional wide raised/lowered borders), which is cool (in my opinion). > >> (The reason I ever consider moving from Tkinter is some inconveniences, >> involving for example window scrolling, plus its smaller amount of >> widgets compared to some other toolkits, plus its (rumored) ugly look on >> certain environments. I will not necessary change the toolkit, but I >> have to consider it) >> >> > > I'm planning to "solve" this, I'm suggesting inclusion of Ttk into > Tkinter for upcoming GSoC. For now you could try using Tile extension, > and update to Tk 8.5. If you don't want to use extensions, then you > will have to wait or change the toolkit for now. > Thanks. I haven't heard of Tile before, now I will keep this in mind. You forgot to mention WHAT you're planning to solve ;-) , so I have to add that Tile is modernization of Tk widgets (so it fixes ugly look). > >> Could anyone with experience in different toolkits help, please >> >> Thanks >> >> -- >> http://mail.python.org/mailman/listinfo/python-list >> >> > > > -- http://mail.python.org/mailman/listinfo/python-list
Re: GUI toolkits with Tkinter's .pack() alternative
Guilherme Polo wrote: > 2008/3/27, Alex9968 <[EMAIL PROTECTED]>: > >> Guilherme Polo wrote: >> > 2008/3/26, Alex9968 <[EMAIL PROTECTED]>: >> > >> >> Hi all, >> >> >> >> I use Tkinter's Pack widget geometry manager (I really prefer it over >> >> using visual GUI designers), so my question is which other GUI toolkits >> >> have similar functionality. >> >> >> > >> > The geometry manager isn't related to using GUI designers tools at >> > all. And each toolkit has it's own way to do the things, wxPython uses >> > sizers, PyGtk uses containers. >> > >> >> Well, the geometry manager isn't *directly* related to using GUI >> designers, but as Pack arranges widgets automatically, using GUI >> designers isn't required, while with geometry managers that don't, GUI >> designers are necessary (if you start placing widgets programmatically, >> you'll end up reinventing something like Tkinter's Pack or Grid geometry >> manager). I hope I can be understood clearly this time ;-) >> > > Not at all, can't understand your point yet. GUI designers aren't just > for placing widgets, they also will keep the interface design > separated from your code. > I do not want to separate interface from code and I do not experience the need to use GUI designers. Pack arranges widgets perfectly, and it's very complex to do the same without it, both in code and in GUI designer. I wish toolkits I use to be able to place widgets one after another automatically. > >>>> Secondly, I like the detailed widget borders configuration possible in >>>> >> >> Tkinter, which can be used to tweak GUI look, and wonder if other >> >> toolkits support it. With Tkinter's case, I like the resulting (tweaked) >> >> look in Windows, but I'm afraid it can be quite different (and ugly) on >> >> other platforms. >> >> >> > >> > You sure can, but differently. >> > >> >> I suppose any toolkit allows setting parameters like "no border", "flat >> border" and "3d border", but which ones can set ANY type of border to >> ANY widget like Tkinter does? For example set GROOVE border to buttons >> and text widgets (instead of traditional wide raised/lowered borders), >> which is cool (in my opinion). >> >> > > The widgets subclass some base class, which contains some common > methods which could be the border and relief for example. > In the case of PyGtk, border > width is controlled at Container, so most widgets will have this > feature, but the relief style of the widget is not common to all > widgets so you will need to check this one (Button has it). > In wxPython, widgets will subclass Window, which has all you want and more. > But PyQt doesn't seem to care much about this, you can change the > widget to flat (if it makes sense to that widget have setFlat method) > but not much related to the borders. > You could recheck your use-cases and see if they are acceptable. > > >> >> (The reason I ever consider moving from Tkinter is some inconveniences, >> >> involving for example window scrolling, plus its smaller amount of >> >> widgets compared to some other toolkits, plus its (rumored) ugly look on >> >> certain environments. I will not necessary change the toolkit, but I >> >> have to consider it) >> >> >> >> >> > >> > I'm planning to "solve" this, I'm suggesting inclusion of Ttk into >> > Tkinter for upcoming GSoC. For now you could try using Tile extension, >> > and update to Tk 8.5. If you don't want to use extensions, then you >> > will have to wait or change the toolkit for now. >> > >> >> Thanks. I haven't heard of Tile before, now I will keep this in mind. >> You forgot to mention WHAT you're planning to solve ;-) , so I have to >> add that Tile is modernization of Tk widgets (so it fixes ugly look). >> >> > > WHAT I'm planning to solve, quote from my own paragraph: > "I'm planning to "solve" this, I'm suggesting inclusion of Ttk into > Tkinter for upcoming GSoC." > > I would like to add the possibility to use Ttk widgets into tkinter, > providing you have Tk 8.5. It would solve the problem of "not enough > widgets" and the other one of "being ugly" mainly. Tk 8.5 also > auto-fixes some other problems, it provides smooth-scrolling for the > text widget, for example. But keep in mind that using Tk 8.5 in Python > is not yet supported (but possible). > I understood you. I added that sentence just to make it clear for anyone reading this. Your participation is appreciated greatly, thank you. -- http://mail.python.org/mailman/listinfo/python-list
Re: GUI toolkits with Tkinter's .pack() alternative
Guilherme Polo wrote: > 2008/3/27, Alex9968 <[EMAIL PROTECTED]>: > >> Guilherme Polo wrote: >> > 2008/3/27, Alex9968 <[EMAIL PROTECTED]>: >> > >> >> Guilherme Polo wrote: >> >> > 2008/3/26, Alex9968 <[EMAIL PROTECTED]>: >> >> > >> >> >> Hi all, >> >> >> >> >> >> I use Tkinter's Pack widget geometry manager (I really prefer it >> over >> >> >> using visual GUI designers), so my question is which other GUI >> toolkits >> >> >> have similar functionality. >> >> >> >> >> > >> >> > The geometry manager isn't related to using GUI designers tools at >> >> > all. And each toolkit has it's own way to do the things, wxPython uses >> >> > sizers, PyGtk uses containers. >> >> > >> >> >> >> Well, the geometry manager isn't *directly* related to using GUI >> >> designers, but as Pack arranges widgets automatically, using GUI >> >> designers isn't required, while with geometry managers that don't, GUI >> >> designers are necessary (if you start placing widgets programmatically, >> >> you'll end up reinventing something like Tkinter's Pack or Grid geometry >> >> manager). I hope I can be understood clearly this time ;-) >> >> >> > >> > Not at all, can't understand your point yet. GUI designers aren't just >> > for placing widgets, they also will keep the interface design >> > separated from your code. >> > >> >> I do not want to separate interface from code and I do not experience >> the need to use GUI designers. >> >> > > It is your opinion, it seems I can't change it for now but I hope you > reconsider it for the future. > > >> Pack arranges widgets perfectly, and it's very complex to do the same >> without it, both in code and in GUI designer. >> > > For some level of "perfect", of course. > Also, I can't understand why you say it is hard to do such thing in a > gui designer tool, which tool have you tried ? Maybe you are not > familiar with them yet, and that could be the problem. > Can you explain why my opinion is to be reconsidered? In GUI designer it's easy to produce initial (still) layout, but what if it should be changed at runtime (for example, widgets added or removed), and still be ideally arranged? I know that widgets might have some parameters affecting for example how they move when their container is resized, and that might help when updating interface, but I think it's inconvenient that they're hidden inside their property sheets (and therefore invisible while designing). I should answer the question - I used Visual C# from Microsoft Visual Studio .NET 2003, and after moving to Python I did not use any GUI designer. -- http://mail.python.org/mailman/listinfo/python-list
Re: GUI toolkits with Tkinter's .pack() alternative
Guilherme Polo wrote: > 2008/3/27, Alex9968 <[EMAIL PROTECTED]>: > >> Guilherme Polo wrote: >> > 2008/3/27, Alex9968 <[EMAIL PROTECTED]>: >> > >> >> Guilherme Polo wrote: >> >> > 2008/3/26, Alex9968 <[EMAIL PROTECTED]>: >> >> > >> >> >> Hi all, >> >> >> >> >> >> I use Tkinter's Pack widget geometry manager (I really prefer it >> over >> >> >> using visual GUI designers), so my question is which other GUI >> toolkits >> >> >> have similar functionality. >> >> >> >> >> > >> >> > The geometry manager isn't related to using GUI designers tools at >> >> > all. And each toolkit has it's own way to do the things, wxPython uses >> >> > sizers, PyGtk uses containers. >> >> > >> >> >> >> Well, the geometry manager isn't *directly* related to using GUI >> >> designers, but as Pack arranges widgets automatically, using GUI >> >> designers isn't required, while with geometry managers that don't, GUI >> >> designers are necessary (if you start placing widgets programmatically, >> >> you'll end up reinventing something like Tkinter's Pack or Grid geometry >> >> manager). I hope I can be understood clearly this time ;-) >> >> >> > >> > Not at all, can't understand your point yet. GUI designers aren't just >> > for placing widgets, they also will keep the interface design >> > separated from your code. >> > >> >> I do not want to separate interface from code and I do not experience >> the need to use GUI designers. >> >> > > It is your opinion, it seems I can't change it for now but I hope you > reconsider it for the future. > > >> Pack arranges widgets perfectly, and it's very complex to do the same >> without it, both in code and in GUI designer. >> > > For some level of "perfect", of course. > Also, I can't understand why you say it is hard to do such thing in a > gui designer tool, which tool have you tried ? Maybe you are not > familiar with them yet, and that could be the problem. > Can you explain why my opinion is to be reconsidered? In GUI designer it's easy to produce initial (still) layout, but what if it should be changed at runtime (for example, widgets added or removed), and still be ideally arranged? I know that widgets might have some parameters affecting for example how they move when their container is resized, and that might help when updating interface, but I think it's inconvenient that they're hidden inside their property sheets (and therefore invisible while designing). I should answer the question - I used Visual C# from Microsoft Visual Studio .NET 2003, and after moving to Python I did not use any GUI designer. -- http://mail.python.org/mailman/listinfo/python-list
Get all strings matching given RegExp
Can I get sequence of all strings that can match a given regular expression? For example, for expression '(a|b)|(x|y)' it would be ['ax', 'ay', 'bx', 'by'] It would be useful for example to pass these strings to a search engine not supporting RegExp (therefore adding such support to it). A program can also let user specify sequence of strings using RegExp (filenames to process, etc.). If there are other types of expressions for these purposes, please let me know. I know that for some expressions there would be infinite amount of matching strings, but these aren't the cases I'm considering. It'd still be possible if string length is limited (there might be large but finite number of matching strings). Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: *.py source file surprisingly deleted with Pydev/Eclipse. Who else experienced this ?
Nebur wrote: > No, I can't reproduce it, and I don't know whom to blame (Pydev? > Eclipse ? The File System ? A Virus that only 2 times in half a year > deletes a single file I'm busy working with, and seems to do nothing > else? Myself beeing schizophrenic ??) A virus created to remind you 2 times in half a year of the importance of backup operations ;-) . I'm joking. I don't know what is this, but I'm interested. Because my files won't be restorable from version control :-( -- http://mail.python.org/mailman/listinfo/python-list
Re: *.py source file surprisingly deleted with Pydev/Eclipse. Who else experienced this ?
Gabriel Genellina wrote: > En Fri, 04 Apr 2008 15:46:48 -0300, Alex9968 <[EMAIL PROTECTED]> > escribió: > >> Nebur wrote: >> > > >>> No, I can't reproduce it, and I don't know whom to blame (Pydev? >>> Eclipse ? The File System ? A Virus that only 2 times in half a year >>> deletes a single file I'm busy working with, and seems to do nothing >>> else? Myself beeing schizophrenic ??) >>> > > >> A virus created to remind you 2 times in half a year of the importance >> of backup operations ;-) . I'm joking. I don't know what is this, but >> I'm interested. Because my files won't be restorable from version >> control :-( >> > > Then implement it! It's not so difficult, less if you're the only one > working on the files. Implement what? The virus? I haven't said that I'm interested in virus, I meant I'd like to know WHAT is this -- http://mail.python.org/mailman/listinfo/python-list
