Forum: Ruby FXRuby ComboBox problems:

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Af95bdaf87958c40150b813e94381bfd?d=identicon&s=25 Christer Nilsson (christer)
on 2006-04-10 20:41
First problem: The empty alternative shows just about two pixels in
height.
""
"male"
"female"
How can I get the full height?

Second problem: The leftmost characters in the combo has a lighter
background color. The number of characters seem to equal the shortest
string
" "      # shortest string
"male"   # m has lighter background
"female" # f has lighter background
How can I get the correct background color everywhere in the combo?

These are minor problems, but disturbing.
I really love the speed and the API of FX, so I'm not ready to switch
yet.

some code:

    # Win XP, FXRuby 1.4.3
    width = 10
    cbo = FXComboBox.new(@parent, width, nil, 0, COMBOBOX_STATIC)
    cbo.appendItem(" ",0)
    cbo.appendItem("female",1)
    cbo.appendItem("male",2)
48d1aca7191f2d16e184971054c7c143?d=identicon&s=25 Meinrad Recheis (Guest)
on 2006-04-10 21:16
(Received via mailing list)
On 4/10/06, Christer Nilsson <janchrister.nilsson@gmail.com> wrote:
> First problem: The empty alternative shows just about two pixels in
> height.
> ""
> "male"
> "female"
> How can I get the full height?
easiest way is to put a space inside instead of an empty string.
annother way would be setting the layout to LAYOUT_FIX_HEIGHT.

>
> Second problem: The leftmost characters in the combo has a lighter
> background color. The number of characters seem to equal the shortest
> string
> " "      # shortest string
> "male"   # m has lighter background
> "female" # f has lighter background
> How can I get the correct background color everywhere in the combo?

strange feature isn't it? don't know when the combobox became like
this. anyway here is the trick that removes the selection of the text:
cbo.children[0].killSelection

hth,
-- henon

[snipped]
Af95bdaf87958c40150b813e94381bfd?d=identicon&s=25 Christer Nilsson (christer)
on 2006-04-11 08:29
I tried the advice, but failed to see any improvement.
LAYOUT_FIX_HEIGHT did not work, and cbo.children[0] refers FXWindow,
not FXTextField, where killSelection is defined.

I must have found a weak spot of FXRuby. The combobox is used for
selecting a string in 90% of all cases. The default behaviour of
FXComboBox is text editing and substring selection.

I've tried to find the source code, but failed.

Christer
48d1aca7191f2d16e184971054c7c143?d=identicon&s=25 Meinrad Recheis (Guest)
on 2006-04-11 09:38
(Received via mailing list)
On 4/11/06, Christer Nilsson <janchrister.nilsson@gmail.com> wrote:
> Christer
>
hmm, sorry. but, i have tried it in FXRuby1.4.4 and i actually got an
FXTextField!
i also checked out the height thing: the height of the combo is always
the same for me ... only the item with the empty string in the list is
very small.

-- henon
This topic is locked and can not be replied to.