Re: GtkEntry right aligned/justified (and Solution)



Hi Egon!


I think, they were talking about scrolling and that the solution in 59799 didn't cover it correctly. I checked the scrolling in my version and seems to be ok.


There is nothing wrong with the scrolling in the solution in 59799.
We just had some discussions about how the code could be written, but the results are the same. There was a little about clamp, where I had a short brain-damage, as at the time where Owen Taylor commented on it, it was almost 6 months since I looked at this. (And now it is another year.)


Well, if your solution is approved then I have no problem in taking mine back in favor of yours. Just, I didn't find any alignment/justification in GtkEntry when I looked for it (gtk+-2.2.2) so I decided to write my own. Do you know which version of gtk contains your changes?

Have you tried to set RTL and used your solution?

No, but my guess is that a string 123 will be right aligned but printed as 321, right? Anyway, I also wanted to have center justification, so RTL won't work for me.

You have default LEFT, which I believe will not be what was expected when RTL.

59799 respects the RTL and an adjustment equal to 0.0 is the default.
An adjustment of 1.0 will do the opposite, which in LTR means right adjusted, but in RTL means left adjusted.

Interesting. For RTL and an alignment in [0;1], this can make sense (but we could also argue on that), but for justification, I think GTK_JUSTIFY_LEFT should always jusify left, no matter what RTL says.

But you are also right and I didn't test my version with RTL.

The solution in 59799 give the possibility to have any alignment, not just right, left and center as your proposal.



This is something I want to discuss. In principle I see no problem in making GtkEntry having any alignment (in [0;1]) and the solution would be straight-forward (given what I have now). But is there any need in having an entry aligned other then left, center, or right? For, a label I see that one might want to have it aligned with a value of 0.1 (so mainly left but also using little space on the left if available), but for a GtkEntry? Would that make sense? Editing a GtkEntry with an alignment of 0.1 might be a strange thing. I only see left, center and right useful like in an text editor: most time you have text left aligned, for numbers you might choose right aligned, and for something pretty, you center it.

Well, my experience it that whenever something is restricted, someone would like to do something that was not possible due to the restrictions.

PangoLayout also knows about left, right, and center aligned only.

Furthermore there must be made test-instructions.



How about, if the entry example covers this? A new choice-type field could be added to the example where the user can select the justification.

I believe a test instruction is a little more than just an example.

Could you please tell me, how such a test instruction could look like?

Kind regards,

   Steffen





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]