andlabs / libui

Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.
Other
10.73k stars 614 forks source link

bug: Height of MultilineEntry seems zero? #83

Open padicao2010 opened 8 years ago

padicao2010 commented 8 years ago

Height of MultilineEntry seems zero. As a result, it is shown as a line.

I replace all uiEntry of examples/controlgallery/main.c to uiMultilineEntry and the 'bug' happens.

Fedora 23, gtk3-3.18.9-1.fc23.x86_64

andlabs commented 8 years ago

Correct. What should the minimum size of a uiMultilineEntry be? Should I add a MustShowNLines() function of sorts? (I know i have to do this for uiArea...) And what about columns?

padicao2010 commented 8 years ago

It looks like a controversial agendum. The minimun width and height of MultilineEntry shoud be determined by some way. Adding MustShowNLines is a good idea. However, I prefer to adding MinSize(w, h) directly.

gnarz commented 8 years ago

some kind of way to specify the minimum height would be good.

andlabs commented 8 years ago

Ideas:

uiEntrySetMinimumWidthInChars() uiMultilineEntrySetMinimumWidthInChars()

would both set the number of characters wide the entries should be at least, with -1 meaning "we don't need to show any number of characters in particular; just use the OS default width for the control"

So for example right now entries are rather long on some platforms; this would allow them to be made shorter

uiMultilineEntrySetMinimumHeightInLines()

likewise

I'm not sure if pixel positioning is a good idea due to the differing nature of different platforms (and likely isn't even possible on some platforms like GTK+ without major hackery).