Re: [pygtk] how to get tabular data in a textview
ok, in this scenario, nothing will be deleted, just scrolls out of view as more info is added at the bottom. Looking at the list view now. thanks sk On Fri, Mar 6, 2009 at 2:54 PM, Steve McClure wrote: > > On Mar 6, 2009, at 3:22 PM, shawn bright wrote: > >> ok, listview looks good, >> the view is constantly scrolling. By that i mean that there are rows >> added all the time. >> It is a constant info update as to what the threads are doing. >> >> If this is a problem, maybe i should go with some other solution > > I have used it where the contents of many rows are changing but not with a > lot of adds and deletes of rows so I can't comment on how well it performs > in that situation. > >> >> sk >> >> On Fri, Mar 6, 2009 at 1:19 PM, Steve McClure wrote: >>> >>> On Mar 6, 2009, at 1:43 PM, shawn bright wrote: >>> Hey all, I have a textview that is really busy in my application. Lots of stuff scrolling all the time. So, what i would like is some way to get my columns of data to line up. Using \t doesn't do too much for this. What would be perfect would be if the the textview could render html, like a table, but even if i need to do something different than a textview, i am willing to learn and use some other tool in pygtk. >>> >>> It sounds like you might want a listview instead of textview. Unless by >>> "scrolling" you mean entering and leaving the view all the time. In that >>> case you might just want to use a fixed width font in the textview. >>> thanks for any tips or advice. shawn ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ >>> >>> -- >>> Steve McClure >>> smccl...@racemi.com >>> >>> >> > > -- > Steve McClure > smccl...@racemi.com > > ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] how to get tabular data in a textview
On Mar 6, 2009, at 3:22 PM, shawn bright wrote: > ok, listview looks good, > the view is constantly scrolling. By that i mean that there are rows > added all the time. > It is a constant info update as to what the threads are doing. > > If this is a problem, maybe i should go with some other solution I have used it where the contents of many rows are changing but not with a lot of adds and deletes of rows so I can't comment on how well it performs in that situation. > > sk > > On Fri, Mar 6, 2009 at 1:19 PM, Steve McClure > wrote: >> >> On Mar 6, 2009, at 1:43 PM, shawn bright wrote: >> >>> Hey all, >>> >>> I have a textview that is really busy in my application. Lots of >>> stuff >>> scrolling all the time. >>> So, what i would like is some way to get my columns of data to >>> line up. >>> >>> Using \t doesn't do too much for this. >>> >>> What would be perfect would be if the the textview could render >>> html, >>> like a table, but even if i need to do something different than a >>> textview, i am willing to learn and use some other tool in pygtk. >> >> It sounds like you might want a listview instead of textview. >> Unless by >> "scrolling" you mean entering and leaving the view all the time. >> In that >> case you might just want to use a fixed width font in the textview. >> >>> >>> thanks for any tips or advice. >>> >>> shawn >>> ___ >>> pygtk mailing list pygtk@daa.com.au >>> http://www.daa.com.au/mailman/listinfo/pygtk >>> Read the PyGTK FAQ: http://faq.pygtk.org/ >>> >>> >>> >> >> -- >> Steve McClure >> smccl...@racemi.com >> >> > -- Steve McClure smccl...@racemi.com ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] how to get tabular data in a textview
ok, listview looks good, the view is constantly scrolling. By that i mean that there are rows added all the time. It is a constant info update as to what the threads are doing. If this is a problem, maybe i should go with some other solution sk On Fri, Mar 6, 2009 at 1:19 PM, Steve McClure wrote: > > On Mar 6, 2009, at 1:43 PM, shawn bright wrote: > >> Hey all, >> >> I have a textview that is really busy in my application. Lots of stuff >> scrolling all the time. >> So, what i would like is some way to get my columns of data to line up. >> >> Using \t doesn't do too much for this. >> >> What would be perfect would be if the the textview could render html, >> like a table, but even if i need to do something different than a >> textview, i am willing to learn and use some other tool in pygtk. > > It sounds like you might want a listview instead of textview. Unless by > "scrolling" you mean entering and leaving the view all the time. In that > case you might just want to use a fixed width font in the textview. > >> >> thanks for any tips or advice. >> >> shawn >> ___ >> pygtk mailing list pygtk@daa.com.au >> http://www.daa.com.au/mailman/listinfo/pygtk >> Read the PyGTK FAQ: http://faq.pygtk.org/ >> >> >> > > -- > Steve McClure > smccl...@racemi.com > > ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Using file URIs.
i guess you can allways use the os.path module though i have only use it on linux systems .. - Original Message - From: "Mats Taraldsvik" To: pygtk@daa.com.au Sent: Friday, March 6, 2009 1:54:39 PM (GMT-0500) Auto-Detected Subject: [pygtk] Using file URIs. Hi, When I use a FileChooser dialog, a list with uris to the files/folders is returned. I want to convert these uris to absolute paths, and want to make this usable in Linux, Windows, Mac... What is the proper way to convert between uris and absolute paths? Mats ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ -- Daniel Hernández Bahr Universidad de las Ciencias Informáticas. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Using file URIs.
On Mar 6, 2009, at 1:54 PM, Mats Taraldsvik wrote: > Hi, > > When I use a FileChooser dialog, a list with uris to the files/folders > is returned. I want to convert these uris to absolute paths, and > want to > make this usable in Linux, Windows, Mac... What is the proper way to > convert between uris and absolute paths? Are you using FileChooser.get_uris()? What if you use FileChooser.get_filenames() instead? > > Mats > > ___ > pygtk mailing list pygtk@daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ > > > -- Steve McClure smccl...@racemi.com ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] how to get tabular data in a textview
On Mar 6, 2009, at 1:43 PM, shawn bright wrote: > Hey all, > > I have a textview that is really busy in my application. Lots of stuff > scrolling all the time. > So, what i would like is some way to get my columns of data to line > up. > > Using \t doesn't do too much for this. > > What would be perfect would be if the the textview could render html, > like a table, but even if i need to do something different than a > textview, i am willing to learn and use some other tool in pygtk. It sounds like you might want a listview instead of textview. Unless by "scrolling" you mean entering and leaving the view all the time. In that case you might just want to use a fixed width font in the textview. > > thanks for any tips or advice. > > shawn > ___ > pygtk mailing list pygtk@daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ > > > -- Steve McClure smccl...@racemi.com ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Using file URIs.
Hi, When I use a FileChooser dialog, a list with uris to the files/folders is returned. I want to convert these uris to absolute paths, and want to make this usable in Linux, Windows, Mac... What is the proper way to convert between uris and absolute paths? Mats ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] how to get tabular data in a textview
Hey all, I have a textview that is really busy in my application. Lots of stuff scrolling all the time. So, what i would like is some way to get my columns of data to line up. Using \t doesn't do too much for this. What would be perfect would be if the the textview could render html, like a table, but even if i need to do something different than a textview, i am willing to learn and use some other tool in pygtk. thanks for any tips or advice. shawn ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Inserting items into ComboBox
Johannes Bauer schreef: > Walter Leibbrandt schrieb: > > >> And so I learn something new! On a hunch, I compared a Glade file with >> an empty (unaltered) combo box and a combo box with its "Items" field >> "changed". I put the "changed" in quotes, because what I did was add a >> character and delete it again, so no text was really added. It turns out >> that the output XML differs by one line that defines an "items" property >> (see attached comboboxes.diff). >> > > Still, this should be used with caution - not all glade versions behave > like this appearently. I'm on a Ubuntu Intrepid Glade 3.4.5. I also have Glade 3.4.5 on Intrepid, and here it worked every time. > Initially, > I have my empty combobox (excerpt form .glade file): > > > True > > > Then I add an item and save: > > > True > foobar > > > and remove the property again and save: > > > True > > > This, the "items" property completely disappered. However, when I > manually modify the glade file in the way you described by applying your > patch (well, manually): > > > True > > > > and load that glade-File in my version of glade and save it again > immediately: > > > True > > > > However, one must be careful with such a version of glade as mine not to > click on the "items" button and click OK, as the property "items" then > disappears again when the Glade file is saved. > > It is unfortunate, in my opionion, that this behaviour obviously differs > between versions of Glade. > > Kind regards, > Johannes > ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Inserting items into ComboBox
Walter Leibbrandt schreef: > Johannes Bauer wrote: >> Timo schrieb: >> >>> for item in ["foo", "bar"]: >>>combobox.get_model().append([item]) >>> >>> Apparently after entering something in Glade, the liststore etc are >>> generated. And by removing these items, it keeps these. >>> >> >> Sadly, my version of Glade does not generate the XML the way you >> described when I do it the way you described :-( >> >> I guess I'll stick with Walter's solution then. It's just very very >> confusing for a GTK beginner to have to do such low-level tasks in order >> to perform such a relatively simple and common thing. >> >> Kind regards and thanks for your help, >> Johannes >> > And so I learn something new! On a hunch, I compared a Glade file with > an empty (unaltered) combo box and a combo box with its "Items" field > "changed". I put the "changed" in quotes, because what I did was add a > character and delete it again, so no text was really added. It turns > out that the output XML differs by one line that defines an "items" > property (see attached comboboxes.diff). > > The inclusion of that "items" property causes the created ComboBox to > be initialized (ListStore and CellRendererText created and correctly > associated with the ComboBox). In fact you can use the *_text() > methods with such an "initialized" ComboBox! > > I've attached my test program and Glade file as well. > > This is certainly a new discovery for me and should make it much > simpler to work with simple ComboBoxes. > > HTH, > Too bad it doesn't work for Johannes. But I'm glad you have the same results as me. It is indeed a whole lot of difference in coding, just by doing this "trick". I hope this helps other people too. Greets, Timo ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Inserting items into ComboBox
Iirc, these functions only work if you already have added at least a single item in the ComboBox Items in Glade. A 'None' would suffice. Mats On Tue, 2009-03-03 at 16:16 +0100, Johannes Bauer wrote: > Hi list, > > I've tried for an hour to insert items into a ComboBox - but just don't > know how. append_text and its variants (insert_text, modify_text, > prepend_text) don't seem to do the job as they're (from what I could > read in the GTK documentation) only available for a specialized > list-type combobox. > > So how do I simply insert items into a combobox during runtime? > > Kind regards, > Johannes > ___ > pygtk mailing list pygtk@daa.com.au > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Inserting items into ComboBox
Walter Leibbrandt schrieb: > And so I learn something new! On a hunch, I compared a Glade file with > an empty (unaltered) combo box and a combo box with its "Items" field > "changed". I put the "changed" in quotes, because what I did was add a > character and delete it again, so no text was really added. It turns out > that the output XML differs by one line that defines an "items" property > (see attached comboboxes.diff). Still, this should be used with caution - not all glade versions behave like this appearently. I'm on a Ubuntu Intrepid Glade 3.4.5. Initially, I have my empty combobox (excerpt form .glade file): True Then I add an item and save: True foobar and remove the property again and save: True This, the "items" property completely disappered. However, when I manually modify the glade file in the way you described by applying your patch (well, manually): True and load that glade-File in my version of glade and save it again immediately: True However, one must be careful with such a version of glade as mine not to click on the "items" button and click OK, as the property "items" then disappears again when the Glade file is saved. It is unfortunate, in my opionion, that this behaviour obviously differs between versions of Glade. Kind regards, Johannes ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Inserting items into ComboBox
Johannes Bauer wrote: Timo schrieb: for item in ["foo", "bar"]: combobox.get_model().append([item]) Apparently after entering something in Glade, the liststore etc are generated. And by removing these items, it keeps these. Sadly, my version of Glade does not generate the XML the way you described when I do it the way you described :-( I guess I'll stick with Walter's solution then. It's just very very confusing for a GTK beginner to have to do such low-level tasks in order to perform such a relatively simple and common thing. Kind regards and thanks for your help, Johannes And so I learn something new! On a hunch, I compared a Glade file with an empty (unaltered) combo box and a combo box with its "Items" field "changed". I put the "changed" in quotes, because what I did was add a character and delete it again, so no text was really added. It turns out that the output XML differs by one line that defines an "items" property (see attached comboboxes.diff). The inclusion of that "items" property causes the created ComboBox to be initialized (ListStore and CellRendererText created and correctly associated with the ComboBox). In fact you can use the *_text() methods with such an "initialized" ComboBox! I've attached my test program and Glade file as well. This is certainly a new discovery for me and should make it much simpler to work with simple ComboBoxes. HTH, -- Walter Leibbrandt http://translate.org.za/blogs/walter Software Developer +27 12 460 1095 (w) Translate.org.za Recent blogs: * Firefox-style button with a pop-up menu http://www.translate.org.za/blogs/walter/en/content/firefox-style-button-pop-menu * Virtaal's MVCisation * Things that changed the way I code --- combo_without_items.glade 2009-03-06 17:05:47.0 +0200 +++ combo_with_items.glade 2009-03-06 17:04:04.0 +0200 @@ -1,11 +1,12 @@ - + True + combo_with_items.glade Description: application/glade #!/usr/bin/env python import gtk from gtk import glade xml = glade.XML('combo_with_items.glade') win = xml.get_widget('window1') win.connect('destroy', lambda *args: gtk.main_quit()) cmb = xml.get_widget('combobox1') # ^^ Note that there is no more combo box initialization above! # Add initial items to combo box for i in ['a', 'b', 'c', 'd']: cmb.get_model().append([str(i)]) # Test _text() methods cmb.append_text('e')# Items: a b c d e cmb.insert_text(2, 'X') # Items: a b X c d e cmb.prepend_text('_') # Items: _ a b X c d e cmb.remove_text(1) # Items: _ b X c d e win.show_all() gtk.main() ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Inserting items into ComboBox
Olav Lavell schrieb: > Perhaps what confuses you is the fact that there is no real difference > between creating the widget at runtime or getting it from the gladefile. > In the above example, where Walter wrote: > > combo = gtk.ComboBox() > > You could also have: > > gladefile = "test.glade" > widget_tree = gtk.glade.XML(gladefile) > combo = widget_tree.get_widget("combobox1") > > Same thing, really. The result is a combo object of class gtk.ComboBox. > Then you start filling its list. Ah, ok. This really confused me, but your explanation makes it clearer. Thanks for your example code which helped me get me a little bit more of a grasp on what I'm actually doing here. I guess the problem is not pyGTK, but GTK here. pyGTK for those calls servers merely as a passing to the C layer of GTK - which is indeed pretty complicated and unintuitive. Ah, I just hope I'll get there at some point. GTK is just really pretty and portable, and IMHO the best window kit there is. Kind regards, Johannes ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Inserting items into ComboBox
Timo schrieb: > for item in ["foo", "bar"]: >combobox.get_model().append([item]) > > Apparently after entering something in Glade, the liststore etc are > generated. And by removing these items, it keeps these. Sadly, my version of Glade does not generate the XML the way you described when I do it the way you described :-( I guess I'll stick with Walter's solution then. It's just very very confusing for a GTK beginner to have to do such low-level tasks in order to perform such a relatively simple and common thing. Kind regards and thanks for your help, Johannes ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Selecting and moving objects on a layout
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 We recently spent a lot of time looking at these canvas's. Many of them seem quite dead in the water. Goocanvas (and pygoocanvas) is quite easy to use but requires all sorts of binary packaging issues. (I.E. Ubuntu's distributed package is quite out of date, which means it's useless). And there's no Win32 Python 2.6 package, which makes it hard to write portable stuff. At least not that we found. Maybe there's one somewhere? Then we found a pure Python LGPL canvas that seems quite great: gaphas. (It's referenced at the bottom of the Project Ridley page). IMHO it'd be great if PyGTK came with a canvas like gaphas. It'd also be cool if it came with some default Pythonic way built-in to do the threading things everyone keeps asking about. :> - -dave Gian Mario Tagliaretti wrote: > On Fri, Mar 6, 2009 at 8:21 AM, student7 - Schlaich, Marc > wrote: > >> http://www.daa.com.au/pipermail/pygtk/2006-March/012002.html >> >> Here is the problem described. > > Well I would suggest just using one of the available canvas instead > of implementing yet another one. > There are quite a few out there, the one I like the best is goocanvas > but here you can see a comparison with the other ones: > > http://live.gnome.org/ProjectRidley/CanvasOverview > > cheers -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iEYEARECAAYFAkmxMwoACgkQtehAhL0gheqDCACfST6KjCUGozr46cIy8U4v6for 2ykAn0VpukCFfpEbvGoq0ZBR3qJm0f0Y =zuAE -END PGP SIGNATURE- ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] PyGtk for Python 3 ?
Johan Dahlin wrote: > On Fri, Mar 6, 2009 at 2:47 AM, wrote: > >> Greetings, >> >> I'm coming to Python at the 3.0.1 version (from a perl5 background, >> as an alternative to perl6 which I'll evaluate when it's available) >> so I'm hanging out for a Py3 version of PyGtk. >> >> Is it known when it might be available ? >> > > http://bugzilla.gnome.org/show_bug.cgi?id=56664 Wow! Johan, that's great! Regards, Rafael Villar Burke ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] PyGtk for Python 3 ?
On Fri, Mar 6, 2009 at 2:47 AM, wrote: > Greetings, > > I'm coming to Python at the 3.0.1 version (from a perl5 background, > as an alternative to perl6 which I'll evaluate when it's available) > so I'm hanging out for a Py3 version of PyGtk. > > Is it known when it might be available ? http://bugzilla.gnome.org/show_bug.cgi?id=566641 -- Johan Dahlin ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Problem with the GC starting in the middle of _wrap_gtk_window_list_toplevels
Margarita Manterola wrote: > I probably screwd up, because it didn't work. This is what I was left with: My code was not meant to be run verbatim, sorry I didn't make that clearer. For example, PyImport_Import takes a PyObject * argument, not a C string, use PyImport_ImportModule instead. This is why you got a crash when you tried to use the returned object (likely NULL or garbage). > // error checking elided for brevity Please don't "elide error checking for brevity" in the code you're using for actual testing, include it! If you're not sufficiently familiar with Python/C, at least read up sections on reference counting and error checking of "Embedding and extending" manual. >> Maybe you're seeing a weird corner case of >> http://bugzilla.gnome.org/show_bug.cgi?id=546802 which is known to cause GC >> to prematurely break cycles which it shouldn't. I'd try applying the fix >> for that bug, maybe it helps. > > I applied that patch and it seems to have worked. No more segfaults, > no calls to the tooltips_destroy. > > However, I have no idea what the patch does and if the bug is really > fixed by this, or it's just a coincidence (being that it's a bug > related to what might happen if GC runs, it's very difficult to > check). The bug causes objects reachable only from GTK be erroneously trashed by the GC. The details are hard to understand because they involve interaction between two reference-counting systems (those of GObject and Python), but that would be the gist of it. It has bitten me in the past and I've reported a duplicate of it. What you saw could well be caused by that bug, but it'd be a good idea to verify it, for starters by confirming that the bug is caused in the GC, and then that the fix for 546802 fixes it. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Selecting and moving objects on a layout
On Fri, Mar 6, 2009 at 8:21 AM, student7 - Schlaich, Marc wrote: > http://www.daa.com.au/pipermail/pygtk/2006-March/012002.html > > Here is the problem described. Well I would suggest just using one of the available canvas instead of implementing yet another one. There are quite a few out there, the one I like the best is goocanvas but here you can see a comparison with the other ones: http://live.gnome.org/ProjectRidley/CanvasOverview cheers -- Gian Mario Tagliaretti GNOME Foundation member gia...@gnome.org ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/