On Tue, Apr 01, 2008 at 06:06:38PM +0000, corvid wrote:
Johannes wrote:
On Tue, Apr 01, 2008 at 03:41:29AM +0000, corvid wrote:
I wrote:
I wrote:
Does anybody remember whether the add() call was for some reason that I haven't noticed?
I don't think it is necessary as long as Group::current() is NULL (no begin() without end ()). Otherwise the popup menu would be added to Group::current() - whatever that is.
I see that Group.h says
void end() {current_ = (Group*)parent();}
so I wonder whether there are still enough begins() and end()s around that some end() is just setting current to Main for us.
No, current_ seems to be NULL now and thereby parent_ of the popup widget is NULL too. But that does not seem to do any harm. (gdb) b menu.cc:263 Breakpoint 1 at 0x806b7bb: file menu.cc, line 263. (gdb) r Starting program: /home/hofmann/projects/dillo/plain/dillo2-hg/src/dillo-fltk dillo_dns_init: Here we go! (threaded) Enabling cookies as from cookiesrc... Fontconfig error: "~/.fonts.conf", line 8: junk after document element Nav_open_url: new url='about:splash' [Switching to process 48228, thread 0x28569000] Breakpoint 1, a_Menu_page_popup (bw=0x285a0a00, url=0x28697580, bugs_txt=0x0, prefs_load_images=1) at menu.cc:266 266 if (bugs_txt == NULL) (gdb) p pm $1 = (class fltk::PopupMenu *) 0x286ec500 (gdb) p *pm $2 = {<fltk::Menu> = {<fltk::Group> = {<fltk::Widget> = {<fltk::Rectangle> = {x_ = 0, y_ = 0, w_ = 0, h_ = 0}, _vptr$Widget = 0x8111440, static default_style = 0x8132fa0, static default_glyph = 0x8130954, label_ = 0x8105d8e "&PAGE OPTIONS", image_ = 0x0, flags_ = 262160, style_ = 0x8131f20, callback_ = 0x80b9778 <fltk::Menu::default_callback(fltk::Widget*, void*)>, user_data_ = 0x0, tooltip_ = 0x0, parent_ = 0x0, type_ = 231 '?', damage_ = 128 '\200', layout_damage_ = 128 '\200', when_ = 4 '\004'}, initial_w = 0, initial_h = 0, children_ = 9, focus_index_ = -1, array_ = 0x287f8600, resizable_ = 0x0, resize_align_ = 15, sizes_ = 0x0, static current_ = 0x0}, static default_style = 0x8131ca0, list_ = 0x8131cfc, item_ = 0x0}, static default_style = 0x8131f20} Cheers, Johannes