SCI Seg3D Mailing List

Text archives Help


[Seg3D] Re: trying to create a new GUI Tool for Seg3D


Chronological Thread 
  • From: Kristen Zygmunt <krismz@sci.utah.edu>
  • To: seg3d@sci.utah.edu
  • Subject: [Seg3D] Re: trying to create a new GUI Tool for Seg3D
  • Date: Fri, 14 Aug 2009 18:30:35 -0600


Ramon,
    I was able to get your code working with the following process:
1) In DialogBlocks, edit the test window to uncheck the wxDIALOG_MODAL style property
2)  Have DialogBlocks generate a test.xrc file for the test panel.
3) Copy all of the object tags from test.xrc into data/Seg3D.xrc (I did this at the end of the file just before the closing resource tag).
4) part of the build process is to copy this file into the bin/data directory. Either rebuild, or manually copy Seg3D.xrc to the bin/ data directory
5)  Try running.

I think the error was occurring because the modal dialog style was enabled, so you should be able to just uncheck the wxDIALOG_MODAL property and then regenerate the Seg3D.xrc directly. However, this did not work for me. Either I am doing something wrong in DialogBlocks or there is something wrong with the Seg3D.pjd file in the repository.

I am curious which method solves the problem for you.

Also, I noticed that the lines:
EVT_BUTTON(XRCID("START_BUTTON"), Test::OnStartButtonClick)
EVT_BUTTON(XRCID("CLOSE_BUTTON"), Test::OnCloseButtonClick)

are missing from your test.cpp file. This did not cause your current problem, but will be needed for your buttons to work.

I will attach my working version of test.xrc . I am curious if the version you get from DialogBlocks matches.

Good Luck!
Kris

test.xrc:
<?xml version="1.0" encoding="iso-8859-1"?>
<resource version="2.3.0.1" xmlns="http://www.wxwidgets.org/wxxrc";>
    <object class="wxPanel" name="ID_TEST" subclass="Test">
        <style>wxTAB_TRAVERSAL</style>
        <title>Test</title>
        <centered>1</centered>
        <object class="wxGridSizer">
            <cols>1</cols>
            <rows>2</rows>
            <vgap>0</vgap>
            <hgap>0</hgap>
            <object class="sizeritem">
<flag>wxALIGN_CENTER_HORIZONTAL| wxALIGN_CENTER_VERTICAL|wxALL</flag>
                <border>5</border>
                <object class="wxGridSizer">
                    <cols>2</cols>
                    <rows>1</rows>
                    <vgap>0</vgap>
                    <hgap>0</hgap>
                    <object class="sizeritem">
<flag>wxALIGN_CENTER_HORIZONTAL| wxALIGN_CENTER_VERTICAL|wxALL</flag>
                        <border>5</border>
<object class="wxStaticText" name="wxID_STATIC">
                            <label>test spinner</label>
                        </object>
                    </object>
                    <object class="sizeritem">
<flag>wxALIGN_CENTER_HORIZONTAL| wxALIGN_CENTER_VERTICAL|wxALL</flag>
                        <border>5</border>
                        <object class="wxSpinCtrl" name="ID_SPINCTRL">
                            <style>wxSP_ARROW_KEYS</style>
                            <value>5</value>
                            <min>0</min>
                            <max>100</max>
                        </object>
                    </object>
                </object>
            </object>
            <object class="sizeritem">
<flag>wxALIGN_CENTER_HORIZONTAL| wxALIGN_CENTER_VERTICAL|wxALL</flag>
                <border>5</border>
                <object class="wxGridSizer">
                    <cols>2</cols>
                    <rows>1</rows>
                    <vgap>0</vgap>
                    <hgap>0</hgap>
                    <object class="sizeritem">
<flag>wxALIGN_CENTER_HORIZONTAL| wxALIGN_CENTER_VERTICAL|wxALL</flag>
                        <border>5</border>
                        <object class="wxButton" name="START_BUTTON">
                            <label>Start</label>
                            <default>1</default>
                        </object>
                    </object>
                    <object class="sizeritem">
<flag>wxALIGN_CENTER_HORIZONTAL| wxALIGN_CENTER_VERTICAL|wxALL</flag>
                        <border>5</border>
                        <object class="wxButton" name="CLOSE_BUTTON">
                            <label>Stop</label>
                        </object>
                    </object>
                </object>
            </object>
        </object>
    </object>
</resource>



On Aug 6, 2009, at 6:41 AM, Ramón Casero Cañas wrote:


Hi all,

Raf (a mate at ComLab) and I have been trying to add a new filter to Seg3D.

We have been following the documentation at "CIBC:Seg3D Develop GUI"

http://www.sci.utah.edu/SCIRunDocs/index.php/CIBC:Seg3D_Develop_GUI

but found that there are some typos and that even after correcting them it doesn't quite work for us.

In particular, we have managed to add code for a new Test tool, as described in the documentation, and then with some tweaks make the code compile.

However, the application crashes at launch. Michael Callahan mentioned that Kristen Zygmunt may be interested in creating a filter, so before leaving on holiday for two weeks, I'm sending to the list a patch with our changes so far (see attached), in case somebody is interested.

We are working based on Revision: 44410.

The error we get is (note that we have added some debugging messages to the code)

<SCREEN>
$ ./Seg3D
Before Create Test
Constructor: before setparent
Constructor: before createcontrols
Before creating controls
Before creating control mSpinner
Before creating control mStart
Before creating control mStopr
After creating controls
Constructor: before getsize
Constructor: before centre

Thread "main" (id: 140524218964000, pid: 13136)
        caught signal SIGSEGV at address 0x19 (segmentation violation)
        ...handle_abort_signals...
niceAbort
Backtrace:
1. ./Seg3D
 in SCIRun::handle_abort_signals(int, siginfo*, void*)
2. /lib/libc.so.6 [0x7fce53261040]
3. ./Seg3D
 in wxWindow::DoSetSize(int, int, int, int, int)
4. ./Seg3D
 in wxWindowBase::DoCentre(int)
5. ./Seg3D
 in Test::Create(wxWindow*, int, wxPoint const&, wxSize const&, long)
6. ./Seg3D
 in Test::Test(wxWindow*, int, wxPoint const&, wxSize const&, long)
7. ./Seg3D
in SCIRun::Seg3DFrame::Seg3DFrame(std::string const&, wxFrame*, wxString const&, wxPoint const&, wxSize const&, long)
8. ./Seg3D
 in Seg3D::OnInit()
9. ./Seg3D
 in wxEntry(int&, char**)
a. ./Seg3D(main+0x12) [0x733ba2]
b. /lib/libc.so.6(__libc_start_main+0xe6) [0x7fce5324c5a6]
c. ./Seg3D [0x733a29]
140524218964000:main( RUNNING, List: )

Abort signalled by pid: 13136
Occured for thread: "main"
Exiting
</SCREEN>

Best regards,

Ramon.

--
Ramón Casero Cañas, DPhil

Computational Biology, Computing Laboratory
University of Oxford
Wolfson Building, Parks Rd
Oxford OX1 3QD

tlf     +44 (0) 1865 610807
web     http://web.comlab.ox.ac.uk/people/Ramon.CaseroCanas
photos  http://www.flickr.com/photos/rcasero/




Archive powered by MHonArc 2.6.16.

Top of page