Unable to change font in BTextView


#21

Here’s the feature description by the way: https://github.com/adamfowleruk/Paladin/issues/91


#22

Yes, i think this could be a good idea!
I was thinking about the same, to put an external editor (pe) in my application.
But i have no clue how to do that.

And by they way, i get rid of BTextView. It is useless for a (programming)Editor.
So i decided to write my own editor, derived from BView.
Its going really well so far.
My code is at https://github.com/Samson666/HaIDE

I dont think that anybody is interested about this.
BUT i think if my editor is working, it maybe a little codebase for you :slight_smile:


#23

The fact that you do not get too much feedback in our community is well known. Therefore you should worry less about it. Work on your editor and make a good docu, there will be people who will use it.


#24

Ahhh… thats really nice from you! I appreciate that!
THX!


#25

Here is my feedback.

  1. Help out with an existing project, read their code - try to understand it and suggest changes where you dont like what they doing. Discuss, make a change or iterate.
  2. Writing your own BTextView is damn hard, it will kill your inspiration in the end. So many have tried and so few have succeeded. I would go with Scintilla instead.
  3. Try to understand BAutolayout, I was also lazy first, but it will pay off in the end.

#26

Yep, maybe you are right. With all. But hey, i’ve come really far for now with my own “BTextView”.
Which it should not be. It’ll be an editor for programmers. Like Pe.
My editor reads files, saves files and, what was really hard, is having a functional cursor :slight_smile:
So, i think i could be a little proud of what i’ve done. And its just a hobby.

And… i was trying the Layout API. Did not work. As i said before. Maybe it works with Haiku standard views, but not with self constructed. So… my fault i think, but i took the hard way :wink:


#27

Hi Samson… if you need fast help there is always also a IRC chat :wink:
And also a german one.

Not shure if i remember it correctly… but i think it could help
the BTextView
but did you tried to place the font setting stuff in the WindowActivated() Method
to make shure every bit is ready to display? just remember that there was a problem
with some code i wrote… (years ago)

I second you whith the Layout API… didnt liked it either… it just dont feel easy and elegant like the BeOs API IT is esay frustrating since it acts different from what you expect
but i needed to learn it too :frowning: :frowning:

I also need to learn git… but this was the best part and i use ist everywhere… :smiley:


#28

Hi Paradoxon (nice nick btw). As you can read or see, i am german, yes ;-).
And its all ok with BTextView. But when it comes to tag special words like #include or so, its useless.
You just cant use it for that. So i decided to make my own editor. Which is not THAT complicated.
AND you have all control over the text.
And yes, Layout API is cool, since you use standard views.
it is while you use? My bad English :slight_smile:


#29

BTextView supports changing textruns as mentioned bevore.
https://www.haiku-os.org/legacy-docs/bebook/BTextView.html#BTextView_SetFontAndColor
and there is no need at all to write a new TextView… since there plenty out there…
E.g. the PE Editor https://github.com/HaikuArchives/Pe
Or for a full featured texview with bullet support and i started to work on improofing the
Haiku Depot textView from Stippi but never came far (since i dont have time) https://github.com/Paradoxianer/StyledEditPlus
based on:
https://github.com/haiku/haiku/tree/master/src/apps/haikudepot/textview


#30

Be sure, i’ve been through with BTextView… With SetFontAndColor and all the other things.
IT IS NOT WORKING… or maybe i am to dumb for that. Yep, i think that it is.
You go through the text of BTextView and setting this and this… Works perfect.
BUT… you are typing in that View… and you wanna see the changes while youre typing… all good…
been there, done that.
BUT when you are deleting some characters… thats where problems start.


#31

Is there any Screenshot of your Editor?


#32

Are you kidding me? It is just able to load and save files and to put the cursor where i want it :wink:
But hey… here is my code: https://github.com/Samson666/HaIDE


#33

Hey thats much more as I can do with cpp :wink:


#34

LOL yes, maybe. I dont know your c++ skills :smile:
And… the coolest thing is… the cursor blinks :wink:


#35

If you have fun to visite the begeistert this year, you can teach me, so i have 1% cpp knowledge after it :wink:


#36

actually i visited his site… or what do u mean?


#37

He means that he wishes that you could go to the Begeistert event itself to teach him there :stuck_out_tongue:


#38

Ahh… i think i realized that he is not the newbe :slight_smile:


#39

And where and when is the Begeistert event?


#40

But we have no free bed places any more, but as dayguest are welcome