[wxhaskell-users] ListCtrl scroll state or Virtual ListCtrl, and I'd appreciate some mentoring

2012-03-26 Thread Aur Saraf
Hello,

I'm trying my hands at cloning Mark Russinovich's amazingly useful
procexp.exe for Linux, as it's hard to live without it. Also a good
chance to finally dirty my hands with GUI programming, weird that I
never have in five years of programming professionally.

To the uninitiated, I'm talking about this:
http://i229.photobucket.com/albums/ee312/Dzomlija/Vista%20Screenshots/process_explorer_2.jpg


I need a ListCtrl that I can edit and not only append to. That means
either a version of appendItem that takes an index that I've missed, a
way to get and later set the scroll-state of a ListCtrl (and then I
can just reset all items on every edit) or a way to use the
wxLC_VIRTUAL style available in C++ wxWidgets.


Can anyone help?


Also, as I said in the title, I'd really appreciate if someone could
take some time to be available for a few beginner questions on some
chat or email platform. I find that wxHaskell has too much lore for me
to learn without an experienced hand guiding me. I promise to research
every question before I resort to asking my mentor.


Thanks,
  Aur

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] ListCtrl scroll state or Virtual ListCtrl, and I'd appreciate some mentoring

2012-03-26 Thread Henning Thielemann

On Sun, 25 Mar 2012, Aur Saraf wrote:

 I need a ListCtrl that I can edit and not only append to. That means
 either a version of appendItem that takes an index that I've missed, a
 way to get and later set the scroll-state of a ListCtrl (and then I
 can just reset all items on every edit) or a way to use the
 wxLC_VIRTUAL style available in C++ wxWidgets.

Note that the 'wx' package provides the high-level interface, but not 
everything can be handled through this interface. A richer set of 
functions is provided by the 'wxcore' package. There you find the modules 
Graphics.UI.WXCore.WxcClassesAL and Graphics.UI.WXCore.WxcClassesMZ that 
provide low-level interfaces to the methods of the classes starting with 
letters A-L and M-Z, respectively.

So if I want to find out about additional functions of listCtrl I first 
look into the wxWidgets documentation, i.e.
   /usr/share/doc/wx2.8-doc/wx-manual.html/wx_wxlistctrl.html

There I find a method named wxListCtrl::InsertItem in various flavors, 
also a variant with an explicit index. Now I can lookup listCtrlInsertItem 
in WxcClassesAL and find according functions.


 Also, as I said in the title, I'd really appreciate if someone could
 take some time to be available for a few beginner questions on some
 chat or email platform. I find that wxHaskell has too much lore for me
 to learn without an experienced hand guiding me. I promise to research
 every question before I resort to asking my mentor.

I think this mailing is a good place because all answers can be seen 
publically and thus may help other people with the same problems.

What I also use frequently in order to find the correct widget class are 
the example collections. There are some Haskell examples in the 'samples' 
folder of the wxhaskell repository and there are even more C++ examples in 
the wxwidgets documentation:
   /usr/share/doc/wx2.8-doc/wx-manual.html/wx_samples.html
  What I am really missing are screenshots of the widgets because often I 
cannot imagine the GUI elements from their literal description.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users


Re: [wxhaskell-users] ListCtrl scroll state or Virtual ListCtrl, and I'd appreciate some mentoring

2012-03-26 Thread Jeremy O'Donoghue
Hi Aur,

On 24 March 2012 22:07, Aur Saraf sonofli...@gmail.com wrote:

 I need a ListCtrl that I can edit and not only append to. That means
 either a version of appendItem that takes an index that I've missed, a
 way to get and later set the scroll-state of a ListCtrl (and then I
 can just reset all items on every edit) or a way to use the
 wxLC_VIRTUAL style available in C++ wxWidgets.


For your purposes, the wrapper of ListCtrl in Graphics.UI.WX.Controls is
probably not going to do everything you will need it to. You will likely
need to drop down to the lower level API in wxcore.

If you look in Graphics.UI.WXCore.WxcClassesAL, you will find a pretty
complete binding to all of the functions in the wxWidgets C++ API. These
all start with listCtrl in their names, and are pretty much exact Haskell
representations of the C++ API functions. As an example,
wxListCtrl::InsertItem() becomes listCtrlInsertItem in Haskell. For
functions which have overloads in C++ (as this example does), you will find
that there are several variants of listCtrlInsertItem which have slightly
different names - the choice of which should be reasonably obvious.

Because the functions in the wxcore API are so closely related to the C++
API, the good news is that you can more or less just translate any sample
code for C++ into Haskell. The bad news is that it feels a lot like
programming in C++.


 Also, as I said in the title, I'd really appreciate if someone could
 take some time to be available for a few beginner questions on some
 chat or email platform. I find that wxHaskell has too much lore for me
 to learn without an experienced hand guiding me. I promise to research
 every question before I resort to asking my mentor.


You will find that list contributors are usually pretty helpful. I would
suggest that that you start with my blog:
http://wewantarock.wordpress.comWhile it is far from complete, and is
only updated rather sporadically, it
has been written to answer some of the issues I came up against when taking
on wxHaskell as a new maintainer.

For your specific problem with ListCtrl, you may do well to look at the
wxWidgets Programming book. This is (obviously) written for C++, but covers
Virtual ListCtrl (on page 330). There seems to be a downloadable PDF at
http://www.google.co.uk/url?sa=trct=jq=esrc=ssource=webcd=5ved=0CGQQFjAEurl=http%3A%2F%2Fptgmedia.pearsoncmg.com%2Fimages%2F0131473816%2Fdownloads%2F0131473816_book.pdfei=DDxwT8KDFMKeOrWwqeEFusg=AFQjCNG49vErXpJEtko5Xe1uROZP-Asp6w

Best regards
Jeremy
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
wxhaskell-users mailing list
wxhaskell-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-users