Hi,
I'm continuing my noodling with UIs using GTK but have hit a problem when
using GTK's dialog functions. They accept a final vararg parameter and I'm
not sure how to specify these when calling from Factor. To whit:
: s>gs ( string -- gstring ) utf8 string>alien ;
: main ( -- )
f f gtk_init
"Hello" s>gs f GTK_FILE_CHOOSER_ACTION_OPEN GTK_STOCK_CANCEL
{ GTK_RESPONSE_CANCEL GTK_STOCK_OPEN GTK_RESPONSE_ACCEPT f }
gtk_file_chooser_dialog_new gtk_dialog_run drop ;
If I try this, I get a message saying "generic word underlying>> is not
defined for string 'gtk-cancel'". I presume that at some point,
GTK_RESPONSE_CANCEL is getting expanded into Factor string "gtk-cancel". I
then tried to fix this by applying [ s>gs ] map to the list, but this also
doesn't work as I get an error saying that s>gs cannot be applied to the
word GTK_RESPONSE_CANCEL. So it seems that s>gs needs to be performed
somewhere during the expansion process, but isn't being. Plus, I don't even
know if this is the right syntax for a varargs call. Is there a standard
for how to do this?
Mark
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk