FLTK logo

Re: [fltk.general] trouble with tree: vanishing cursor and focus problems

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: trouble with tree: vanishing cursor and focus problems Greg Ercolano May 21, 2021  
 

On 5/21/21 9:24 AM, lifeatt...@gmail.com wrote:

FLTK 1.4, not too old; Linux MATE 20.1; gcc 9.3.0.

    I think what's missing is you need to tell Fl_Tree_Item about the widget by calling
    Fl_Tree_Item::widget(_text).

    The test/tree.cxx example shows how this works.

    begin(); // For some reason this magic is required when adding new items

    The reason for begin() is Fl_Tree is derived from Fl_Group, so when you add FLTK widgets
    to the items, you have to call begin() before creating the FLTK widget so it gets added to Fl_Tree's group.

    The reason for the Fl_Tree_Item::widget() is the item needs to know which FLTK widget
    is associated with it, so it can manage it during drawing.

    You may need to change your code a bit, as I think you had to jump through some hoops
    to get your MyText widget to work around the missing widget() call..


--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/be6e1cdd-b24c-6c83-5190-d874c765cbc8%40seriss.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.