BWindow::Pulse never fires

I’m writing that big clock app I mentioned earlier. I got the layout set up and showing the time on startup, and am trying to use BWindow::Pulse (like the Clock replicant) for that. However, the event handler seems to never fire. Can any of you guide me through using it?

I can post the sources on GitHub if needed. Also, if it’s more appropriate, a BMessageRunner can also be used here.

You need a view with the B_PULSE_NEEDED flag for this event to be delivered to it (and Pulse() is a BView, not a BWindow method). And you need to set the pulse rate using SetPulseRate() (on the window, this time).

And yes, if you’re going to allow it to be used as a replicant, a BMessageRunner could be a better choice, otherwise you will need to alter the pulse rate of the embedding window, which isn’t so nice (it’s fine when you do it in your own application, but doing it to someone else’s window is not great)

Yeah, there are no BViews in the design, so moving to a BMessageRunner is a better choice. When I was trying the two, Paladin failed to build the project with a cryptic linking error (I copied the project folder, which apparently is a bad idea), so naturally I gravitated towards the simpler choice.

Will report back!

And it works!

My first Haiku app running proud

I’ll tell you guys a little bit more about this project. This is a clock app with L A R G E letters intended to be a replicant, either on your desktop (Conky users raise your hand!) or on the Shelf screensaver (Which is where I’m actually intending to put it, basically as a lock screen for my installation).

2 Likes

thanks… i love conky… :point_up:

Locale kit integration is here! Note to self: Document BTimeFormatStyle/BDateFormatStyle. The Locale settings dialog has a nice example.

The whole UI is now functional!

1 Like

:raising_hand_man:

Btw, I started cleaning up all the X11 mess in Conky, so maybe someday we’ll get a native GUI for it.

1 Like

wow …great… love to hear that

Well, it turns out, I somehow can’t get the message to come through to the BView XD, MessageReceived never fired.

I have a BMessageRunner binded to the View on construction, and the window currently doesn’t have a handler.

Yes, that doesn’t work. One way to do it is to set up your messagerunner from the BView’s AttachedToWindow() method, as that is called after the view is attached to the window which acts as its looper for receiving messages.