[Gambas-user] for XMahjongg players
Eldon Eller
eeller at ...826...
Mon Mar 28 21:08:07 CEST 2005
If any of you play xmahjongg (available at
www.lcdf.org/~eddietwo/xmahjongg/), here is a little gambas trifle that
eliminates an annoyance. Xmahjongg comes with 11 layouts and 8 tilesets,
but to play anything but the default game, you have to type a bunch of
stuff in a terminal window, e.g., xmahjongg -t dorothys -l arena. Here
is the solution I came up with: Make a form with 11 buttons with the
group property layout, and 8 buttons with the group property tileset.
Set the text of each button button in the layout group to the name of a
layout, and similarly with the buttons in the tileset group. Then add
one more button with text "play". I have included the code because it is
so short and sweet. Then edit the K menu to include xmahjongg (if you
haven't already), and set the command to the name of this gambas
project, not xmahjongg. When you select xmahjongg from the K menu, this
little gambas project will pop up. Select the layout and tileset and
press play, and, voila, up comes xmahjongg with the chosen layout and
tileset. If you want to play the default game, you can just press play
without selecting anything.
Thank you, Benoit, and all the others who have provided this lovely
plaything.. EEE
' Gambas class file
'Selects layout and tileset for XMahjongg
PUBLIC layout$ AS String
PUBLIC tileset$ AS String
PUBLIC SUB play_Click()
EXEC ["xmahjongg","-l" ,layout$,"-t",tileset$] FOR WRITE
END
PUBLIC SUB layout_Click()
layout$=LAST.text
END
PUBLIC SUB TileSet_Click()
tileset$=LAST.text
END
PUBLIC SUB Form_Open()
layout$="default"
tileset$="thick"
END
More information about the User
mailing list