xlabel - hook problem Thread last updated on 2005-11-25 14:02:02

Posted by member 221443 on 2005-11-14 10:37:54

Hi I got a project im working on, and im trying to hook two xlabels on each other.

Here is the two labels:

; --- HiraganaChart ---
*Label HiraganaChart
HiraganaChartAddToGroup Hiragana
HiraganaChartX 200
HiraganaChartY 200
HiraganaChartWidth 105
HiraganaChartHeight 345
HiraganaChartImage $img$\hiragana\HiraganaChart_bg.png

; --- Hiragana ---
*Label Ha
HaAddToGroup Hiragana
HaX $HiraganaChartX+5$
HaY $HiraganaChartY+20+5$
HaWidth 15
HaHeight 15
HaImage $img$\hiragana\ha.png

Now the problem starts: How do I hook the Ha (label) onto the HiraganaChart?
I have read the help for xlabel a few times and im going nuts...In the help file this line is used as example:

*(label-name)ModuleHook !LabelLsBoxHook (hooked label-name)

i tried to use this but didnt work:
*HiraganaChartModuleHook !LabelLsBoxHook Ha

It always complains about, that I already created Ha and asks me to remove if there is several of them.

Suggestions, plz.

Posted by member 1885 on 2005-11-14 11:44:19 link

If you remove the "*Label Ha" line it should work.

Posted by member 221443 on 2005-11-14 13:17:01 link

Tried it now, but dont work, because its not visible :(
thanks for the suggestion anyway, West.

here it the whole file: (its in a theme.rc in $themedir$)
; -=================================- Theme -=====- ;
ThemeName "none so far"
ThemeAuthor "Minori"
; -===============================- Include -=====- ;
img $themedir$\images
; -===============================- NetLoad -=====- ;
*NetLoadModule jdesk-0.73
*Netloadmodule xLabel-3.4.8
; -=================================- JDesk -=====- ;
jDeskWorkArea 0, 0, 0, 0
; -================================- Labels -=====- ;
HiraganaChartMoveable true
HiraganaChartMoveModifierKey ".none"

; --- Hiragana Chart ---
*Label HiraganaChart
HiraganaChartX 200
HiraganaChartY 200
HiraganaChartWidth 105
HiraganaChartHeight 345
HiraganaChartImage $img$\hiragana\HiraganaChart_bg.png

; --- Hiragana ---
*Label Ha
HaX $HiraganaChartX+5$
HaY $HiraganaChartY+20+5$
HaWidth 15
HaHeight 15
HaImage $img$\hiragana\ha.png


the *.png files is not important, im using a black picture for the chart and a white picture for the Ha picture.

Posted by member 212670 on 2005-11-14 14:20:12 link

Might be a module bug, since 3.4.8 is brandnew. Try it with 3.4.5. and see what your results are.

Posted by member 221443 on 2005-11-14 15:03:52 link

Its the same result, except the msgbox dont show this time (the one saying that I got several create of an label), I tested 3.4.5. and 3.3.8.

Can anyone try and see if it works for you?

Posted by member 12025 on 2005-11-14 15:17:44 link

(ls.net eating code)

Posted by member 12025 on 2005-11-14 15:18:12 link

...

Posted by member 12025 on 2005-11-14 15:19:04 link

HaX $HiraganaChartX+5$
HaY $HiraganaChartY+20+5$

0,0 is the parent window's 0,0; not the display's 0,0. This sets HaX to be a full 100px beyond the right edge of the parent.

Try this:
; -=================================- Theme -=====- ;
ThemeName "none so far"
ThemeAuthor "Minori"
; -===============================- Include -=====- ;
img $themedir$\images
; -===============================- NetLoad -=====- ;
*NetLoadModule jdesk-0.73
*Netloadmodule xLabel-3.4.8
; -=================================- JDesk -=====- ;
jDeskWorkArea 0, 0, 0, 0
; -================================- Labels -=====- ;
HiraganaChartMoveable true
HiraganaChartMoveModifierKey ".none"

; --- Hiragana Chart ---
*Label HiraganaChart
HiraganaChartX 200
HiraganaChartY 200
HiraganaChartWidth 105
HiraganaChartHeight 345
HiraganaChartImage $img$\hiragana\HiraganaChart_bg.png

; --- Hiragana ---
*HiraganachartModuleHook !LabelLSBoxHook Ha
HaX 5
HaY 25
HaWidth 15
HaHeight 15
HaImage $img$\hiragana\ha.png

Posted by member 212670 on 2005-11-14 15:41:31 link

***, hooking 101...surprised I didn't see that in Minori's setup.

Posted by member 221443 on 2005-11-14 15:51:39 link

Its working!!, thanks so much Cerbie :)

btw. first time using hooks, and i have searched for guides for them, but with no luck.

Posted by member 1949 on 2005-11-15 10:29:26 link

Don't forget to stick with OTS2 structure for your theme.

ConfigDir "$ThemeDir$Config"
LSImageFolder "$ThemeDir$Images"
MiscDir "$ThemeDir$Misc"
WallDir "$ThemeDir$Wallpaper"

And use "quotes" on your variables like

"$LSImageFolder$Hiragana\"

Posted by member 268387 on 2005-11-25 14:02:02 link

Hello,people! Iuse LS 0247 RC3 and xLabel. I dont remember version, but i know, that i have such kind of problem: when i try to hook one label into another there comes a message "*$LabelName$ModuleHook !LabelLsBoxHook $LabelName$" $themedir/theme.rc$ not defined. What did i do wrong?