Scrollbars/Viewports etc.

Hello,
I am new to Swing, well, sort of, but I have a problem that I'm not really looking for the answer to, more just in case there's some sort of weird bug that I'm not aware of. I don't want to be banging my head against a brick wall!
I'm trying to write a kind of IRC client. The server was simple, but I need to write a Java GUI - lots of clients, all on different platforms (lots on OS X interestingly). All I want to do is to do a text box that's like the one I'm typing into at the moment, where it automatically scrolls down the the lowest possible position as you type.
However, what I've found, is that after having tried three approaches to this:
1: do the math(s) and call the setRectToVisible(...) method
2: use someone else'e code from the internet that does similar maths
3: do scrollPane.getVerticalScrollBar().setValue(scrollPane.getVerticalScrollBar().getMaximum());
That no matter what I do, it doesn't work... And it doesn't work in pretty much the same way, which is why I'm asking the question. It sort of works. Most of the time, it's one text line above the bottom. Sometimes it goes right up to the top, and rarely, it does what it's supposed to do.
Is this a known problem? Am I doing something extremely stupid? I haven't bothered posting all the code as people get a bit bored of that, but I'm pretty sure that's OK. It's a scrollpane with the child set to a JTextPane object. Nothing else.
Many thanks,
K.

I haven't bothered posting all the code as people get a bit bored of that,Well all the code is not part of the problem. You should be posting the part of the code that is directly related to the problem. This is called a SSCCE.
Actually I get bored more reading a question where 90% of the text is not related to the problem. Keep the question simple and accurate.
All I want to do is to do a text box that's like the one I'm typing into at
the moment, where it automatically scrolls down the the lowest possible position as you type.I don't understand the question. This is the default behaviour of a JTextPane added to a JScrollPane. As you type the text pane scrolls. I'm assuming of course that you added the scroll pane to the frame.
I suspect your real question is about appending text to a text pane as it is received from the Server.
Or are you suggesting that you can actually type text into the text pane at the same time as the Server is appending text to the text pane?
Assuming you are just trying to append text the see the answer above, but use textComponent.getDocument().getLength() instead of the getText() method (its more efficient).
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Similar Messages

  • [SOLVED] Unity-Overlay Scrollbar.. trying to get it working...

    Hi,
    I'm trying to enable the unity scrollbars inside XFCE.
    I have installed the latest gtk2-ubuntu and gtk3-ubuntu, but run into problems.
    When installing gtk2-ubuntu everything hangs and I cannot login to a XFCE session.
    gtk3-ubuntu installs fine, but no overlay scrollbar is visible.
    I have used the following PKGBUILD (mod from atanas - aur) to install gtk3-ubuntu:
    pkgname=gtk3-ubuntu
    pkgver=3.4.3
    pkgrel=1
    pkgdesc="GTK+ is a multi-platform toolkit (v3) with Ubuntu's modifications"
    arch=('i686' 'x86_64')
    url="http://www.gtk.org/"
    install=gtk3.install
    depends=('atk' 'cairo' 'gtk-update-icon-cache' 'libcups' 'libxcursor' 'libxinerama' 'libxrandr' 'libxi' 'libxcomposite' 'libxdamage' 'pango' 'shared-mime-info' 'colord')
    makedepends=('gobject-introspection')
    provides=("gtk3=$pkgver")
    conflicts=('gtk3')
    options=('!libtool' '!docs')
    backup=(etc/gtk-3.0/settings.ini)
    license=('LGPL')
    source=(http://ftp.gnome.org/pub/gnome/sources/gtk+/3.4/gtk+-$pkgver.tar.xz
    settings.ini
    016_no_offscreen_widgets_grabbing.patch
    017_no_offscreen_device_grabbing.patch
    043_ubuntu_menu_proxy.patch
    062_ubuntu-set-grab-add.patch
    075_expose_gdkwidget_for_gtkrange.patch
    sha256sums=('846010442a96590469cde16ed6a1fdfe09397e435165459f04d31cfa5713799f'
    'c214d3dcdcadda3d642112287524ab3e526ad592b70895c9f3e3733c23701621'
    'c4a43b254b9719ac026fa6a92366bdc1d32e42fa79461ff8aaa206933b9f9c7e'
    'cb8f4eb9d10c6d8645d23812aaa7d64c14560476f19f8c779d10a546748de684'
    '3c40814a3ba51dbbd169b5fc8f4a3c47aff6c5b97433a1f6c13fa66d465947d9'
    '5a89bd63afb2d97b98eb3b7acb5a568c388aedd94af38a1106233ce033982354'
    '9ee240b355502d6ba449983f794205e6e5401c8acca2a3ce513df7f0502dc988')
    build() {
    cd "$srcdir/gtk+-$pkgver"
    # Don't let offscreen widget do grabbing (fix for ido)
    patch -Np1 -i "$srcdir/016_no_offscreen_widgets_grabbing.patch"
    # Do not allow widgets in an offscreen hierarchy to take grabs (fix for ido)
    patch -Np1 -i "$srcdir/017_no_offscreen_device_grabbing.patch"
    # Add Ubuntu menuproxy module (required for appmenu-gtk)
    patch -Np1 -i "$srcdir/043_ubuntu_menu_proxy.patch"
    # Add ubuntu-set-grab-add signal (required for ido)
    patch -Np1 -i "$srcdir/062_ubuntu-set-grab-add.patch"
    # Add gtk_range_get_event_window to get the event_window for a GtkRange (fix for ido)
    patch -Np1 -i "$srcdir/075_expose_gdkwidget_for_gtkrange.patch"
    # Add support for the ayatana overlay scrollbars (required for overlay-scrollbar)
    #patch -Np1 -i "$srcdir/100_overlay_scrollbar_loading.patch"
    # Partially revert BGO#673440 in order to fix BGO#674157
    #patch -Np1 -i ../wacom.patch
    aclocal -I m4
    libtoolize --copy --force
    automake
    CXX=/bin/false ./configure --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --enable-gtk2-dependency \
    --disable-schemas-compile
    #https://bugzilla.gnome.org/show_bug.cgi?id=655517
    sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
    make
    package() {
    cd "$srcdir/gtk+-$pkgver"
    make DESTDIR="$pkgdir" install
    install -Dm644 "$srcdir/settings.ini" "$pkgdir/etc/gtk-3.0/settings.ini"
    As you can see, I have removed some patches (scrollbar patch, etc.) otherwise it wont compile.
    I don't know if the patches are required, as I thought they merged into the main source?
    Could also someone help me with gtk2-ubuntu? I don't know why this is hanging.
    I have not tried it in a non XFCE-session through.
    Has someone been able to get it working? (Lower version perhaps?)
    Thanks!
    Last edited by beta990 (2012-06-28 09:56:30)

    Oke, given up.. seems like they patch things different in gtk3.. thanks anyway.

  • Scrollbar  in forms 6i

    Dear all,
    Can anyone assist me with the codes of enabling scrollbar? I have no idea of how to enable it to scroll
    Thanks in advance

    Dollongo,
    In Block Property Palette, there is a property Group Scrollbar.
    In that group u can see the properties of show scrollbar, scrollbar canvas etc........
    if its not what u want then say details ...
    Regards,
    Manu.

  • Scroll JTable in Scrollpane with mouse drag

    Hello developers !
    I'm trying to make a scrollable Jtable. The table have to be scrollable with the mouse drag event. But I have a "flashing" Problem. I can catch the Mouse events from the table (I'm listener the mouse motion and mouse events).
    When I receive a new mouse drag event, I set the new position from the viewport. The problem is, that the Table flash:
    For example:
    I drag the mouse to the bottom of the table. The mouse "y" position have to increase, but it doesn't:
    first motion event position (10, 10)
    second motion event position (10, 15)
    third motion event position (10, 12)
    etc..
    The position of the mouse event are in relation of the component position. I think, the problem is that I change the position of the view port and than the new mouse event is "on a wrong reference".
    Could someone help me? How could I make a work around for this Problem?

    I have the solution... it is easy.
    I post the solution because i spent two days making working around (changing viewport position other scrollbar values, etc).
    You dont need to implement the Autoscroll interface. The Autoscroll interface is for Drag and Drop classes.
    The key was the function JTable#scrollRectToVisible....
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class ScrollableTableFrame extends JFrame{
      protected ScrollableTable table;
      public ScrollableTableFrame() {
        super("Scrollable Table");
        setSize(600, 300);
        String data[][] = new String[40][40];
        String header[] = new String[40];
        for(int i = 0; i < 40; i++){
          header[i] = "Header " + i;
          for(int j = 0; j < 40; j++){
            data[i][j] = "(" + i + ", " + j +")";
        ScrollableTable table = new ScrollableTable(data, header);
        table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        JScrollPane sp = new JScrollPane();
        sp.getViewport().setBackground(table.getBackground());
        sp.getViewport().add(table);
        getContentPane().add(sp, BorderLayout.CENTER);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setSize(400, 400);
        setVisible(true);
      public static void main(String args[]){
        new ScrollableTableFrame();
    class ScrollableTable extends JTable{
      private Point firstPressedPoint;
      public ScrollableTable(Object rowData[][], Object columnNames[]){
        super(rowData, columnNames);
      protected void processMouseEvent(MouseEvent e){
        int id = e.getID();
        switch(id) {
          case MouseEvent.MOUSE_PRESSED:
            firstPressedPoint = e.getPoint();
            break;
          case MouseEvent.MOUSE_RELEASED:
            firstPressedPoint = null;
            break;
          case MouseEvent.MOUSE_CLICKED:
          case MouseEvent.MOUSE_EXITED:
          case MouseEvent.MOUSE_ENTERED:
        super.processMouseEvent(e);
      protected void processMouseMotionEvent(MouseEvent e){
        if(e.getID() == MouseEvent.MOUSE_DRAGGED){
          Rectangle r = getVisibleRect();
          Point p = e.getPoint();
          int dx = (firstPressedPoint.x-p.x);
          int dy = (firstPressedPoint.y-p.y);
          Rectangle aRect = new Rectangle(r.x + dx, r.y + dy , r.width + dx, r.height + dy);
          scrollRectToVisible(aRect);
    }P.S.: jarshe, thank you for your help !!

  • Scim makes leafpad take a while to load, except when run from terminal

    Leafpad normally loads up in an instant. But with scim running (More specifically with the required environment variables exported. Scim simply running without the environment variables does not cause the problem, but then scim does not work.), although it shows up immediately, the scrollbar, menubar etc are greyed out for a few seconds and the program cannot be used until it is fully loaded.
    I'm sure this is specifically a leafpad problem, because there is no noticable lag in other programs. (Mousepad for example is fine.) However, the fact that it loads immediately when run from a terminal scares me. Why doesn't gmrun (and the fvwm menu) work just like a terminal? Is there a possible fix to this problem?

    droog wrote:
    I'm not having this problem as far as i can see, I use fvwm and scim already so installed leafpad to test and it starts instantly from fvwm's menu or terminal.
    from gmrun leafpad starts instantly too so maybe i'm missing something.
    what are you exporting?
    Just the normal:
    export XMODIFIERS=@im=SCIM
    export GTK_IM_MODULE="scim"
    export QT_IM_MODULE="scim"

  • Is it possible to import one spark component without importing the entire spark library?

    I want to create an actionscript mobile application project because the total size will be smaller than a flex mobile application - the SDK is smaller because it doesnt contain unnecessary libraries e.g. the spark, mobilecomponents, framework etc. are not included. There are however 1 or 2 spark and mobile comonents that i would like to use and it seems a little silly to import the entire swc libraries for a couple components. So herewith my question... Is it possible to import a spark or mobile component without actually importing the entire swc library?

    Hi Gordon,
    Im using option 2: Merged into code. I have just recreated this on a colleague's laptop as well with the same result.
    Could you perhaps see if you can follow these steps and see what happens on your side.
    Create a new Flex Mobile Project > SDK 4.6.0 > Google Android Platform > Blank Application Template > Finish
    Add <s:TextInput/> under declarations tag
    Export Release Build > Intermediate AIRI package that must be manually signed later > Finish
    Decompile the SWF from the .airi package (I'm using Sothink SWF Decompiler)
    Expand Action > Spark > Components
    My components folder contains many spark components im not interested in packaging - see screenshot attached above for the full list. All we added was a spark textInput and the swf contains Buttons, Scrollbars, TabbedViewNavigator etc. Thus the reason for this post.

  • Bouncing comps

    I need a better way of bouncing png/jpg comps from reflow projects. I need to be able to export high quality images to use for marketing material, to send via email quickly and to show  how the software looks on various devices and browsers and bounce that as an image. I end up previewing the design in chrome or the iphone emulator (c/p the link from chrome preview) and then taking screenshots but the resulting quality isn't very good.
    I think there's a simple way to solve this that could also prove to be a key advantage in getting people to convert from Illustrator, Sketch and Photoshop to Reflow. Most design tools have an export function so you building something similar in the file menu. Not only do you allow the user to choose file type and page - you also let them choose all the screen sizes they want those pages bounced at (iPhone, S4, iPad, some desktop viewports etc).
    This takes advantage of the fact that in reflow you're designing a multi-device representation of your software vs. punching pixels into a grid and I think will really help people start to understand the speed advantage that you get from using a tool like this.
    Stephen

    It's a solution when you have 15 clients on set and don't want all of them huddled around the Digi setup, it's practicality. If a cable gets stepped on or pulled, a drink gets spilled, or just the overall abuse it causes. Your lack of real world knowledge is clear, when we have our cart set with two 24" or 2 30" monitors, not such a big deal as I can turn one towards another area so they can view away from the setup, desk mounted in smaller spaces, horrible. It also protects the photographer if something goes wrong that one it can be acknowledged discreetly, two I can get to them instead of leaving my setup un manned and having a nosey art director screwing with the computer, believe me it happens, camera goes down, something crashes, my jobs is to make sure I have access to the photographer and my gear to fix it right away without halting production, there's a reason I make my day rate... If its a small editorial Job and were working off the 17" MBP, bringing a second monitor is foolish, we have 15 minutes to get the subject in and out, no need, hand the pr person, creative director or who ever and iPad and it gives them a direct line to us. This isn't coming from a " I show flowers and pets, my kids and weddings place" this is coming from we shoot billboards, ads and magazine covers.... These shoots are high pressure and the clients want to feel plugged in, they don't want to stand at a monitor all day... I've ran 50ft dvi cables and split secondary displays, that's a solution as well... Capture one just made my life and the clients life better, I've been on set where everyone has an iPad, well here you go folks download this app, get on our private network and boom, sit back enjoy your day in comfort. It was a real world question. Enjoy.
    Oh and the iPad, much better looking then what 90% displays look like, fact. We have two 30" dells, two 24" cinema and two 24" hp's, all high end pro monitors, the iPads not far off...

  • Defaults.css sporadically ignored

    I have a shared library project that specifies skins for common elements (scrollbars, buttons, etc.) in a defaults.css file.  The AIR and Flex applications that use this library usually pick up the styles fine, but sometimes they seem to be overridden by normal skins.  Skins for custom components are always found, as there's no other skin specified for them anywhere.  Components from other shared libraries with local skins also often default to their library skins rather than the local ones.
    Sometimes I can resolve this by cleaning my projects a few times.  I've hit it a few times though where even cleaning didn't resolve the problem, and the only resolution was to delete all of the projects and check them out of SVN again.  Is this a known issue?  I can't produce it consistently enough to create a test case to attach to a Jira.

    hello,Darrell
    I created a new set of Flex component library slib.swc (Flex 4.5). Would also like to have a default style. defaults.css file, making it the default style of the component library.
    Like flex the builder install directory of sdks \ 4.5.0 \ frameworks out \ libs directory has a spark.swc file, open with Winrar will see defaults.css this file. Defaults.css file defines the default style of the flex spark components.
    How can it be achieved?
    As follows
    slib.swc contains a CLabelEx components, and a defaults.css file
    defaults.css source file as follows:
    @ namespace s "library :/ / ns.adobe.com / flex / spark";
    @ namespace mx "library :/ / ns.adobe.com / flex / mx";
    @ namespace cn "http://os.slib.cn";
    cn | CLabelEx
            styBackgroundAlpha: 1;
            styBackgroundColor: # 569CC0;
            styBorderAlpha: 1;
            styBorderColor: # 569CC0;
            styBorderWeight: 1;
            styCornerRadius: 3;
    In slib.swc the application MyLabel.mxml of the source file as follows:
    <? xml version = "1.0" encoding = "utf-8"?>
    <s: Application, the xmlns: fx = "http://ns.adobe.com/mxml/2009
                               xmlns: s = "library :/ / ns.adobe.com / flex / spark"
                               xmlns: mx = "library :/ / ns.adobe.com / flex / mx"
                               xmlns: cn = "http://os.slib.cn
                               the minWidth = "955" The minHeight = "600">
            <fxeclarations>
            </ fxeclarations>
            <cn:CLabelEx x="67" y="112"/>
    </ s: Application>
    I hope CLabelEx default use cn | CLabelEx, style to display its appearance.
    I refer to above approach, but failed to achieve. Can you please re-Detailed
    thanks,

  • Terrible reading experience...

    I downloaded the AIR app on my Macintosh to read monographs made available by my university library.
    The resulting pages are one-third-filled with a single page-wide column of tiny text — text that occasionally overlaps with itself. So far as I can determine, the text cannot be reflowed into a more readable format/larger size. This makes printing untenable: the text size is too small *for me,* and I use no vision correction, in the resulting document. It is too small to read un-zoomed on a 22-inch display. God help the laptop set. The footnotes are not only not hyperlinked, but the UI makes it very difficult to move back and forth between the main text and end-notes. Even advancing a page at a time cannot reliably center on the third of the page that has any text on it. In short, this is totally unusable.
    I'm not sure if this is Adobe's fault or the fault of whoever authored the eBook, but it sure as hell isn't working for me. Is there anything I can do?

    Thanks Jim_Lester.
    The file I downloaded from the library catalog was a .acsm file. It seems, poking around, that the book file is a PDF, which certainly explains why I couldn't reflow the text. There wasn't any especially obvious way to find that out — e.g. greyed out controls for resizing and reflowing text, that would make clear that those options weren't available with this document.
    As for AIR, I guess I was fooled by the total lack of standard system menus, scrollbars, controls, etc.: there's no "Select all...", no "Find Again...", no Application Preferences... It isn't really a Macintosh application at all.
    Well, this is one of those situations where other people — at the library, at the press — have made choices that I just have to live with.

  • What version of jre is the older style java look and feel?

    I have two windos xp systems, one running the 1.5.0_05 JRE and one running the 1.4.2_08 JRE.
    The system that has the more up to date version has a more aesthetically pleasing java (metal) LookAndFeel. The older version has dark gray buttons/backgrounds and has purple scrollbars. The newer version has a lighter gray background with light blue (and partially shaded) buttons, scrollbars, checkboxes, etc.
    Does anyone know what version of the JRE made the move from the older style LookAndFeel to the newer one?
    Thanks!

    There were only maintence releases between 1.4.2 and 1.5.0. So the answer is 1.4.2 (old) 1.5.0 (new).

  • "Screen Melting" with KMS, new x lagginess without it

    A recent update installed KMS and for awhile everything was fine. However, a subsequent call to pacman -Syu didn't have such an innocuous effect. I have no idea what's going on. I've never seen this before.
    X windows and video display in general is fast with KMS enabled; however, something randomly goes very wrong. All of a sudden, my screen appears to be darkening from the edges, moving towards the center, while at the same time everything blurs together and the screen appears to be "oozing" liquid crystal from the top and bottom. Obviously, the machine is totally unresponsive when this happens. It's like a very distressing special effect.
    Fortunately, I can manually reboot the machine and get the system back up. So far, this has never happend when working solely in the terminal frame buffer. On the other hand, when I disable KMS via "nomodeset" (or any other tricks mentioned on the wiki or in the forums), all graphical components are incredibly laggy, and it's not like I'm doing any fancy desktop cube, wobbly windows, or compositing of any sort; I'm using Ion, a 1MG tiling window manager.
    At any rate, this is very annoying. I've asked for help in the achlinux freenode channel to no avail. I don't even know what kernel version or xorg server version or ati driver version to rollback to. I have always used xf86-video-ati without a single problem; now scrolling, tabbing between windows, switching viewports, etc. lags as if my CPU is constantly maxed out (and it's not).
    Could someone please help? Thanks.
    My video card is an X300 mobile radeon. Dell inspiron 6000. A couple years old.

    I have the same problem with my ATI X1700. In my case it happens from time to time when system starts up.
    You can try to disable KMS and then disable "glx" module in X server by adding the following entry to xorg.conf:
    Section "Module"
    Disable "glx"
    EndSection

  • Default Windows font scaling renders the Flash Pro UI unusable

    If I have font scaling on my laptop set to anything other than 100% (125% is the Windows default for comfy-to-read text) the Flash Pro UI is also scaled, and the content within each panel is cropped, so that you miss scrollbars, buttons, etc.
    The only way round this that I can find is to set the global font scaling to 100%, but that makes it very difficult to read all other apps.
    Does everyone get this?
    Cheers,
    Dave

    System: Windows 8.1
    Flash Pro CC 2014.2 (Feb 2015)
    Computer: Thinkpad X230T
    Resolution: 1366x768 (doesn't matter as it fails even when used in external monitor 1920x1200 res)
    Windows Display Scaling: 125%
    The scaling issue makes Flash unusable in 125% display scaling. Setting the scaling to 100% and 150% works fine.

  • Upgrade the D700 GPU

    Could Apple please provide updated drivers for the D700 GPU.  Maya is having some serious issues, particularly with dynamic playback.  Once a simulation starts it's almost impossible to stop it, I usually have to wait until the sim reaches the end of the timeline.  Interactive playback also is virtually un-usable.  I've read that people running boot camp on the same Mac Pro set up have no issues with Maya, and the consensus is that there is a driver issue slowing down Maya on OSX.
    This is a pro machine that has certified GPU's by Autodesk, I would expect this to run faster than my 4 year old PC and 3 year old Macbook Pro.
    Please resolve this.
    Kris.

    I think you're getting two different technologies confused, Grant. Unless I'm misunderstanding the original poster's intent, OpenCL and OpenGL are two very different things that improve performance in different ways.
    In fairness to Apple, anyone buying one of these should expect it will be a year from the original announcement or more, before devs start releasing software with OpenCL optimizations. We'll see what SIGGRAPH brings next week or the week after. That will be very telling as to 3D developers' intentions, and whether they think the new Mac Pro design is worth optimizing for or not.
    However that's a separate issue from Apple's OpenGL implemention (which is completely under their control) and driver quality (also completely under their control). Even with no OpenCL features yet, all of the 3D apps' performance (and some other apps like Premiere and After Effects) could be improved in their current state, just by Apple having a better OpenGL / driver implementation (mainly in the areas of better frame rates while editing in viewports, etc).

  • Making VBox/HBox scrollable

    Hi,
    For the record, I'm very new to JavaFX and it's been pretty cool playing with it so far.
    I've been scouring the net to find something substantial on making scrollbars, listviews, etc. but it generally seems there is a lack of support for scrolling or nothing simple in nature to get something like a vbox/hbox scrollable. I am aware of the media player example Sun has posted up, but it's a bit complicated to go through.
    What I'm trying to do:
    -I have a simple custom node that displays an image and text to the right of the image.
    -I have a database that JavaFX connects to (via a java class) which returns a sequence of my custom nodes with an image and some text
    -When I put the sequence into a VBox everything looks great but inevitably I will have a large number of nodes returned from the database which will require scrolling
    I've been spending some time reading and looking at examples but I'm still at a loss.
    How can I add a scrollbar to my VBox/HBox so that I can cycle through the sequence of custom nodes?
    Thank you,
    Nik.
    Edited by: infra1 on Oct 22, 2009 11:09 PM

    Here is a way I found (updated my listing above):
    class ColorRect extends CustomNode
      public-init var val: Integer;
      override function create()
        id = GetId(val);
        Stack
    //~       id: GetId(val)
          nodeHPos: HPos.LEFT
          content:
            Rectangle
              width: Rnd(30, 100)
              height: Rnd(10, 30)
              fill: Color.rgb(Rnd(255), Rnd(255), Rnd(255));
            Text
              content: "{val}"
    function GetId(val: Integer)
      return "CR{%04d val}"
    var dataDisplay = VBox
      spacing: 5
      content:
        Rectangle { width: 30, height: 30, fill: Color.RED }
        for (i in [ 1 .. 50 ]) ColorRect { val: i }
        Rectangle { width: 30, height: 30, fill: Color.RED }
    def viewHeight = 200;
    var clipper = ClipView
    //~   clipY: bind scroller.value
    //~   pannable: false // Either pannable or depending of a scroll control
      // Or as I do here, don't use bind but on replace
      node: dataDisplay
      layoutInfo: LayoutInfo
        width: 150
        height: viewHeight
    var scroller = ScrollBar
      vertical: true
      min: 0
      max: bind dataDisplay.boundsInLocal.height - viewHeight
      layoutInfo: LayoutInfo
        height: viewHeight
      override var value = 0 on replace
    //~ println("Data height {%.0f dataDisplay.boundsInLocal.height} SB H {height} Min {%.0f min} Max {%.0f max} Val {%.0f value}");
        clipper.clipY = value;
    var scene: Scene;
    var positionInput: TextBox;
    Stage
      title: "Scrolling test"
      width: 250
      height: 350
      scene: scene = Scene
        content:
          VBox
            translateX: 20
            translateY: 20
            spacing: 10
            content:
              HBox
                content:
                  clipper,
                  scroller,
              HBox
                spacing: 5
                content:
                  positionInput = TextBox
                    promptText: "Jump position"
                    action: JumpTo
                  Button
                    text: "Jump"
                    action: JumpTo
    function JumpTo(): Void
      var pos = Integer.parseInt(positionInput.text);
      var id = GetId(pos);
      var n: Node = dataDisplay.lookup(id);
      println("{pos} {id} {n} {n.boundsInParent}");
      var realPos = n.boundsInParent.maxY;
      scroller.value = scroller.max * (realPos / dataDisplay.boundsInParent.height);
    function Rnd(low: Number, high: Number): Number
      return low + (high - low) * Math.random();
    function Rnd(high: Number): Number
      return Rnd(0, high);
    }As you can see, I associate an ID to each node in the list. When I want to jump to a position, I lookup this node and get its vertical position within the list of nodes. Then I deduce the scrollbar value to set to get it displayed.
    Note: I opened the RT-6366: Incorrect min value on ScrollBar (not public, as usual... :-()
    If it was something I did wrong, I suppose I will know. Otherwise, I hope they will correct it soon.

  • OpenBox Way better then KDE4.... Better then KDE3 :) [COMPLETED]

    Well I was vary upset about the move to KDE4.1. I was a big fan of KDE3.5.9. I even started a "Mad" thread about it (that I regret doing). However, OpenBox has all the things I liked about KDE3.5.9 and more
    Stability is the main thing for me. I don't wan't to see any bugs at all and this is one of the views of the OpenBox team as well. I also like to control every aspect of my box and OpenBox is all about this too. Simpel and Light are the two other things that are a must for me and OpenBox is just that.
    Anyway, What are some cool things you could suggest I do to it/ install ? I first -Rnsc KDE then -S gnome to give it a base to run on but I boot into OpenBox not Gnome/OpenBox.
    Last edited by hunterthomson (2008-08-03 21:37:52)

    hunterthomson wrote:
    Ya, I know I didn't need to intsll gnome, dosn't really keep with the minimalistic wants, but I was haveing problems with with my sys after uninstaling KDE i.e. startx and OpenBox would not start... The EZist way out was just to install Gnome. Gnome comes is handy though. It handels my wallpaper and the way butons/ scrollbars look(theme Areo with Buuf-Deuce-Icons). I wish I could upload screen shots to archlinux-foums. So far I have tlida and screenlets (system mon) both with a cut of my wallpaper so they look trasparent. Pypanel, but I don't use it anymore now I just use stalonetray and the keybinding to select minimized widows/ desktops. Thunar as thunar --daemon in my all setup autostart.sh. OBmenu and set up my menu. Obconf and set up stalonetray and have Manum_openbox as my theme. All, Is looking really kool.  Owe, Also I have Vieanna3 as my curser.
    Using OpenBox as a DE seems like the way to go. I love the menu by just clicking on the desktop. I wanted to use it when I first swiched to Arch but I wanted to learn one new thing at a time.
    Thankyou for the link that has a lot of good stuff
    So many things in this post are
    But that's ok. You're new. Welcome to minimalism.
    First off, you're saying you're using the gnome suite because "It handels my wallpaper and the way butons/ scrollbars look(theme Areo with Buuf-Deuce-Icons)." Both of these aspects can be controlled WITHOUT gnome. In gnome, Nautilus handles what wallpaper is set. Nautilus is a filemanager which also can control automounting of volumes and such. The reason I bring this up is because you're saying you ALSO run Thunar as a daemon. Why? If it is in order to automount volumes, you already have a program capable of doing this running.
    But in general, using Nautilus (or Thunar if you stick with that (which I recommend)) to display the background will, if not configured correctly, disable the right click on the desktop. This is why it's usually a good idea to get a program that will only set your background and nothing more. The programs suggested by jealma are all viable, as is nitrogen, suggested by xd-0.
    Second, gnome uses gtk2 to display the scrollbars, buttons, etc. known as widgets. You don't need gnome to use gtk2. Just install gtk2, then set your theme manually via your .gtk2-rc file, or via a program such as lxappearance (as suggested by xd-0. lxappearance will also allow you to set your icon theme.
    "Using OpenBox as a DE seems like the way to go." Careful who you say this around. Most OB zealots will throw a fit. I shuddered after reading it. See jealma's post.
    "I wish I could upload screen shots to archlinux-foums." You can. Get the program "scrot" and learn how to use it (`man scrot` or just google search it). Then go to a free image hosting site, such as tinypic, imageshack, xs.to, photobucket, etc. and upload it there. Then paste the link here.
    That all being said, welcome to the minimalistic world of Openbox.

Maybe you are looking for