# Label editable partly

**URL:** <https://forum.juce.com/t/label-editable-partly/32878>\
**Category:** General JUCE discussion\
**Created:** [April 16, 2019, 2:06pm UTC](https://forum.juce.com/t/label-editable-partly/32878 "2019-04-16T14:06:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pajczur](https://avatars.discourse-cdn.com/v4/letter/p/e9a140/32.png) [@pajczur](https://forum.juce.com/u/pajczur)\
**Post date:** [April 16, 2019, 2:06pm UTC](https://forum.juce.com/t/label-editable-partly/32878/1 "2019-04-16T14:06:30Z")

</div>

Hello,  
I wonder is there any easy way to make `JUCE::Label` editable partly? Or do I need to write my own method or class?

I mean something like that, my label text is for example “x / 10”, and I want to be able to edit only “x”.

---

<div class="post-metadata">

**Author:** ![alassandro](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/alassandro/32/4297_2.png) [@alassandro](https://forum.juce.com/u/alassandro)\
**Post date:** [April 16, 2019, 2:58pm UTC](https://forum.juce.com/t/label-editable-partly/32878/2 "2019-04-16T14:58:47Z")

</div>

I think you would have to make your own custom implementation for this, I’m not sure of any JUCE features that allow for this…

I believe one way you could do it is to have some sort of “post-fix” text that is always added to the “editable” text.

Then whenever the label shows its editor - `Label::editorShown()` - you can set the editor’s text to just the editable part (“x”), and when it’s hiding - `Label::editorAboutToBeHidden()` - you can add the post-fix text (" / 10") to what the user typed in (the new text for “x”).

At least that’s one way I’ve handled this kind of thing before 🙂 if you want it to be where just the text editor appears over the “x” then you could achieve it by using two labels and some positioning…
