Re: [gtk-list] Re: Icons and DnD?



Michael Sobolev wrote:

> On Tue, Jun 02, 1998 at 03:04:22AM +0000, Marsel Osipov wrote:
> > Hmm....Check my code...it's c++ but really easy to understand
> >
> > void VFileManager::ShowFileIcon(VFmStruct *file)
> > {
> >   cout << "called ShowFileIcon()" << endl;
> >   Gtk_VBox pbox(false, 0); // pixmap box
> >   Gtk_EventBox eventbox; // eventbox
> >
> >   eventbox.add(file->icon); // add the file icon to the eventbox
> >   pbox.pack_start(&eventbox, FALSE, FALSE, 0); // pack the eventbox into the VBox
> >   Gtk_Label file_l(file->name); // new label
> >   pbox.pack_start(&file_l, FALSE, FALSE, 3); // pack the name of the file into the VBox
> >
> >   // add icon
> >
> >   // show icon
> >   eventbox.show();
> >   pbox.show();
> >   file_l.show();
> >   file->icon->show();
> > }
>
> Hmm...  Code looks fine.  Where this file->icon comes from?  Are you sure that
> it's OK?
>

It comes from a structure.  Yes it is ok, because if i do just file->icon->show() i get the
icon, but if i try to pack the icon into a box, the program crashes.

> Actually, I am clueless.  I would have a look on backtrace when you program
> crashes.  Otherwise... :)
>

It does not dump core.....And it sucks...it seems that it should work, but it does not.  The
error that i get shows that one of the widget does not have a parent.  I assume it's one of
the boxes or most likely both.What widget do you use to hold all of your icons?

Arhrhrhrhrhr....this sucks.....

Marsel Osipov

> --
> Mike
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]