[haiku-development] Re: making my textview active

  • From: "Stephan Assmus" <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 14 Oct 2009 21:12:43 +0200

Hi,

> Niels Egberts <niels.egberts@xxxxxxxxx> wrote:
> > Currently I'm creating a todo-app, I have a problem with creating a
> > textview. I have this class:
> 
> This kind of discussion should be moved to the 3rd party development 
> list.
> 
> > class TodoText : public BTextView {
> >     public:
> >             TodoText(BRect rect);
> >             void AttachedToWindow();
> >             void MouseDown(BPoint point);  };
> > 
> > And this MouseDown function:
> > 
> > void TodoText::MouseDown(BPoint point)
> > {
> >     printf("test\n");
> >     MakeFocus();
> >     BTextView::MouseDown(point);
> > }
> > 
> > But MouseDown never gets called, so I can't type in my textfield. How
> > can I solve this?
> 
> You're obviously doing something wrong, as you don't need this to be 
> able to type at all.
> Have you by any chance created a B_AVOID_FOCUS window?

Additionally, are you sure that your text view is actually added to the window 
the way you intended it to be? If you SetText("Some text which should be 
visible.") on your text view, does the text display?

Best regards,
-Stephan

Other related posts: