widgetstatic help

  • Loren Semple

    Loren Semple - 2008-10-14

    Hi, I have a program created using the latest smartwin, and I am having issues dealing with WidgetStatic Widgets.

    Basically I have around 15 different WidgetStatics' places randomly on the main part of my program, each one placed left of to its own textbox, (being used as its label).

    The problem is, using setBounds() for my WidgetStatics only allows you to go by the top left X position. I only have the right X position for my WidgetStatic, so, I tried the following:


    setbounds ( right_pos_x_integer -  textsize.x , y_pos_integer ,  textsize.x ,  20);

    //using 20 because it is only one line of text.
    //right_pos_x_integer = the X position of the textbox (left side), for alignment purposes.

    I thought this would work to keep the space between the right side of the static text and the left side of its textbox equal for all the statics and textboxes on the main part of my program, but, it seems as though the larger the static text is, the greater the space between the static and the textbox.


    I get the following

    age:  [textbox]   <--- smallest space between static and textbox

    first name:    [textbox]           <--- larger space

    email address:         [textbox]       <--- largest space

    can someone please show me a way to solve this problem as I've been working on it for ages, and not quite sure how to fix it.

    • Loren Semple

      Loren Semple - 2008-10-15

      if I knew how to search this forum (Sourceforge changed its search engine), I would probably be able to find the answer I am looking for.

      Every time I type in something into sourceforges search bar at the top I get mixed results about other projects and stuff, how do I search just the smartwin forums ?

    • Loren Semple

      Loren Semple - 2008-10-16

      in the documentation section for Smartwin, I came across this statement regarding the function getTextSize()

      "It accounts for the set font too."

      for the problem I have posted above, I have found a solution.

      when I change the font to "system" getTextSize works!, but when the font is set to default font, it does not work, and I get the problem that I have posted above.

      thanks for your time reading this stuff.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks