Page 1 of 1

Tooltip question

Posted: Sat Nov 05, 2011 3:27 pm
by marksmithhfx
Hi, is there a tooltip property for Data Grids?

Re: Tooltip question

Posted: Sat Nov 05, 2011 6:19 pm
by mwieder
A data grid is a group. I set tooltips on some individual items in a datagrid when I place them in the grid. What are you trying to accomplish?

update: if you need to set a tooltip on the whole datagrid, try something like

Code: Select all

set the tooltip of graphic "dgAlternatingRows" of group "Datagrid 1" to "hahaha"

Re: Tooltip question

Posted: Sun Nov 06, 2011 4:25 am
by marksmithhfx
Thanks Mark. I'll give that a try. I just wanted to have the tooltip say "Double Click to Edit". I'll post an example of the UI. I guess I could do the edits in the dg fields (datagrid window), but it just seemed easier to open the record in a separate window for editing.

Re: Tooltip question

Posted: Sun Nov 06, 2011 8:08 pm
by marksmithhfx
Hi Mark, here is the basic layout of the UI and some of the functionality. You'll need to use the "create new" database option (it prompts you, or should) and add a record or two (using the + button). When you hover over the empty rows of the dg you get the tooltip "Double Click to Edit" which, while useful, is not really appropriate (the rows are empty). Better would be to have the tooltip appear when you hover over an actual record. That was my idea going into this; I think most of the UI is self evident, however it is not obvious (to me anyway) that double clicking on a record lets you edit it, so I thought a tooltip might be the trick.

Keep in mind this example is not polished
No attempt was made to make it look pretty
I'm basically trying to work out the UI elements and application functionality
Its not finished
Its not thoroughly debugged... apologies in advance if you end up in the debugger
I have not added townsends excellent looking "last resort" error handling routine... yet :D

Thanks for having a look.

-- Mark

Re: Tooltip question

Posted: Sun Nov 06, 2011 8:41 pm
by mwieder
Looks nice and works well so far - no dropping into the debugger here. The tooltip shows up nicely and double-clicking did the trick.

I don't know where you're heading with this, but if you're going to build a standalone, keep in mind that changes to custom properties in a standalone aren't persistent - you'll have to store preferences in a separate text file or something. If it's going to be a stack rather than a standalone app then the openStack handler asks me if I want to create or open a database, but then the stack is still in edit mode, so you might want to "choose browse tool" afterwards.

Re: Tooltip question

Posted: Sun Nov 06, 2011 10:06 pm
by marksmithhfx
mwieder wrote: I don't know where you're heading with this, but if you're going to build a standalone, keep in mind that changes to custom properties in a standalone aren't persistent - you'll have to store preferences in a separate text file or something. If it's going to be a stack rather than a standalone app then the openStack handler asks me if I want to create or open a database, but then the stack is still in edit mode, so you might want to "choose browse tool" afterwards.
You're right. I forgot about the persistence issue in standalones. What's the best way to handle parameters? In this case I'll want to know the path to the db, and probably a couple of settings so I can reopen the display at the same place. I don't mind writing things out to disk and reading them back but where is the best place to put them? (and keeping in mind the different operating systems). Has anyone worked out a "generic" approach that works equally well on mac, windows and linux?

Also, thanks for the "browse tool" tip. I actually didn't know that.

-- Mark

Re: Tooltip question

Posted: Tue Nov 08, 2011 10:44 pm
by mwieder
Has anyone worked out a "generic" approach that works equally well on mac, windows and linux?
specialFolderPath("preferences") works out to be safe storage for both OSX and Windows. Linux is a bit trickier since it's not as hardcore about where things go. I usually use specialFolderPath("home") and then create a folder or see if there's already a "Documents" folder and put it in there. If you can guarantee that the user has root permissions you can try putting something in /opt. But you can be pretty sure that the user has permission to store anything in the "home" folder hierarchy.

Re: Tooltip question

Posted: Wed Nov 09, 2011 12:32 am
by FourthWorld
mwieder wrote:specialFolderPath("preferences") works out to be safe storage for both OSX and Windows.
"Preferences" on Windows? When I try it here it returns empty. What do you get there?

Re: Tooltip question

Posted: Wed Nov 09, 2011 7:36 am
by mwieder
"Preferences" on Windows? When I try it here it returns empty. What do you get there?
...serves me right for thinking I know what I'm talking about and not testing things first. Now that I've gotten back to my Windows machine I see that specialFolderPath("Documents") works on Windows and is probably a safe place to start. I'd say the same about OSX, but I'm still on Snow Leopard and I've heard some strange things about supposedly safe folders on Lion.

Check the docs for what specialFolderPath() options work on different OSes.

<there... that sentence should be safe...>