[Gtk-sharp-list] Removing all the widgets from a table Mac OSX GTK#

Billy Schoenberg wasbridge at gmail.com
Sat Jun 28 13:52:48 EDT 2008


Hey,

Thanks for the response. I do not think the code I use to reattch them is an
issue, but I have attached it below.  The reason I do not think its an
issues is because if i comment out those lines I showed you last e-mail the
program does not crash, it just piles widgets on top of each other.  Also
this code works just fine on Windows (all versions) and Linux (SUSE and
Ubuntu) I use the "Native Version" of GTK on OSX 10.5 with Mono 1.9.1 that I
installed 3 or so months ago.  Do you have any ideas about a work around,
another way to remove widgets from a table?

 public override void LayoutPropertiesPanel()
        {
            if(showPropPanel)
            {

                Table GTKTable =
drawView.Controller.GTKObjectPropertiesTable;

                GTKTable.Attach(typeIndicator, 1, 4, 2, 5);
                GTKTable.Attach(nameBox, 1, 4, 6, 8);

                GTKTable.Attach(xLabel, 4, 6, 2, 5);
                GTKTable.Attach(xBox, 4, 6, 6, 8);


                GTKTable.Attach(yLabel, 6, 8, 2, 5);
                GTKTable.Attach(yBox, 6, 8, 6, 8);

                GTKTable.Attach(widthLabel, 4, 6, 9, 12);
                GTKTable.Attach(widthBox, 4, 6, 12, 14);

                GTKTable.Attach(heightLabel, 6, 8, 9, 12);
                GTKTable.Attach(heightBox, 6, 8, 12, 14);

                GTKTable.Attach(buttonModeCheckBox, 8, 12, 11, 15);

                GTKTable.Attach(fillLabel, 8, 10, 2, 5);
                GTKTable.Attach(fillButton, 8, 10, 6, 8, AttachOptions.Fill,
AttachOptions.Expand, 0, 0);

                GTKTable.Attach(strokeLabel, 9, 13, 2, 5);
                GTKTable.Attach(strokeButton, 10, 12, 6, 8,
AttachOptions.Fill, AttachOptions.Expand, 0, 0);

                GTKTable.Attach(strokeWidthLabel, 12, 15, 2, 5);
                GTKTable.Attach(strokeComboBox, 12, 15, 6, 8,
AttachOptions.Fill, AttachOptions.Expand, 0, 0);
                if ( showEvents )
                {
                    GTKTable.Attach(eventsLabel, 15, 18, 2, 5);
                    GTKTable.Attach(eventsComboBox, 15, 18, 6, 8,
AttachOptions.Fill, AttachOptions.Expand, 0, 0);

                    eventHandlerBox.BorderWidth = 1;
                    GTKTable.Attach(eventHandlerBox, 18, 31, 2, 15);
                    eventHandlerBox.GdkWindow.Background = new Gdk.Color(0,
0, 0);
                }

                GTKTable.ShowAll();
                UpdatePropertiesPanel(); // sets all of the values of the
widgets we just attached
            }
        }

Billy

On Sat, Jun 28, 2008 at 12:48 PM, Michael Hutchinson <
m.j.hutchinson at gmail.com> wrote:

> On Sat, Jun 28, 2008 at 2:31 AM, Billy Schoenberg <wasbridge at gmail.com>
> wrote:
> > Hi,
> > I am having a problem removing all of the widgets from a table.  I use
> this
> > code
> >
> > foreach ( Widget c in controller.GTKObjectPropertiesTable.Children)
> >                 {
> >                    controller.GTKObjectPropertiesTable.Remove(c);
> >                 }
> > to try to clear a table, but it gives this exception
> >  at (wrapper managed-to-native) Gtk.Application.gtk_main () <0x00004>
> >   at (wrapper managed-to-native) Gtk.Application.gtk_main () <0xffffffff>
> >   at Gtk.Application.Run () <0x0000a>
> >   at Open_Dialect.MainWindow..ctor (string) [0x0070a] in
> > /Users/Billy/Desktop/Open Dialect/Open
> > Dialect/OpenDialect/FormsAndViews/MainWindow.cs:257
> >   at Open_Dialect.Program.Main (string[]) [0x0005f] in
> > /Users/Billy/Desktop/Open Dialect/Open Dialect/OpenDialect/Program.cs:43
> >   at (wrapper runtime-invoke)
> > Open_Dialect.Program.runtime_invoke_void_string[]
> > (object,intptr,intptr,intptr) <0xffffffff>
> > yes that is the full stack trace, it is missing pieces and I do not know
> > why.  The first time this piece of code is called it works fine, removes
> the
>
> It an unmanaged segfault in the main loop. Something you've done
> leaves this in a state that doesn't immediately cause problems, but
> makes the main loop crash.
>
> > widgets from the table, but then after I reattach them and call this
> method
>
> What's the code that you use to re-attach them?
>
> > again it throws this exception.  Any ideas?  Who to report to?  I am
> having
> > a lot of trouble registering for the Bugzilla at Novell.
>
> Have you seen http://www.mono-project.com/FAQ:_Novell_Bugzilla ?
>
> Also, are you using the X11 or "native" version of GTK on OS X?
>
> --
> Michael Hutchinson
> http://mjhutchinson.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20080628/d0f30c42/attachment-0001.html 


More information about the Gtk-sharp-list mailing list